Painting the glass is one option. A better idea is tinting the glass. I have seen kits for applying a plastic film to glass at Home Depot. Plus kits are available at auto supply stores.
Using the tinting film is a better idea as it is easily reversible in the future.
If you still want to paint the window glass a solid color, make sure to prime the glass with a good acrylic primer first. Zinsser 123 should work. Then apply your paint. This will fully cover and obscure any light.
Heat shouldn't be an issue as long as a very dark color isn't used.