Using radiant barrier to keep a room warm
Does it matter what kind of foil I use? Is anything better than the &quot;normal&quot; foil used for food storage?

Foil reflects heat by reflecting light that would normally be absorbed by the surface (or what's behind the surface, in the case of glass). By bouncing that light back into the room the energy is retained. Obviously this means that the more reflective (shiny) the surface, the more effective it will be.

Does it matter whether the cavity between the foil and the window is not completely sealed?

Not with respect to radiant heat reflection. Obviously it would help with insulation and heat loss in general.

Does foil work significantly better than any white opaque surface?

Yes. It better reflects all of the light spectrum (visible and not). A very glossy white surface could come close, I suppose.

Are there common conditions that I might not think of where this would not work?

Not really, assuming typical household circumstances. All matter emits heat energy, so the more heat and light in the room the more there is to contain through reflection.

Can foil also prevent radiative heat loss if I use it to cover a wall/ceiling? If so, is is partially effective if the wall/ceiling is only partially covered?

Sure. This is why foil-faced insulation panels exist. It's not usually practical for an interior surface, though, for reasons of aesthetics and durability.

Will I need to make sure that any pipes running through the covered walls do not require heat from my living space to prevent freezing?

That is a concern which varies with climate, existing insulation, etc.

Are there any special precautions I should take in a room heated by baseboard heat?

Not really. You'll still need to maintain safe clearance to combustibles, of course.

Can I also use foil on my walls/ceiling to increase solar heat gain when condition are appropriate?

This would probably be counter-productive. You want your interior surfaces to absorb light and heat in winter, not reflect it.

Is this a giant waste of time?

The benefits are unlikely to outweigh the detriments (cost, effort, loss of visibility and natural light) unless you're facing a severe energy crisis. For that reason it's rarely done. There are films that reflect some heat while maintaining partial visibility, but they would obviously cost more than basic foil.