It's not actually gold foil, it's typically a mettalised polymer film, Kapton. This becomes part of a multi-layer insulation material where each layer is composed of a different material that has certain advantageous properties, with all of the layers separated by a small shim between them to avoid thermal conduction.
I really gotta stop playing so much Kerbal Space Program.
Most of the shiny 'gold' things seen in aerospace and motorsports is just vapor deposited Kapton/polymide.
But there are applications where gold is indeed used - but it's unclear (in the literature I've read) when/where it's appropriate to use gold. The helmet use case I can believe. I also imagine large swathes of gold would be problematic - structural surfaces being unnecessarily conductive or introducing inductive noise.
The US Navy EA-6B Prowler, an airplane that emits a LOT of radio frequency energy, has a conductive gold layer on its canopy for Faraday cage reasons, to protect the crew from the radar jammer.
I really gotta stop playing so much Kerbal Space Program.