So why wouldn't a gun in space be like a gun in a thermose? There are no air particles bumping into it leaching off heat.
Heat is transferred by 3 methods:
1. Conduction – heat transferred from one material to a second lower temperature material that is touching the first. You touch something hot and get burned, that’s conduction.
2. Convection – heat carried away a moving fluid, like air or water. Wind chill, as explained in post #45 above is convection (although some feel it is only convection if the fluid movement is caused by the heat changing the density of the fluid and causing it to move.)
3. Radiation – Heat leaving a mass by infrared emissions. The heat you feel standing in front of a fire is radiation.
From a gun in space there will be no heat transfer by the first two, only the third. Infrared heat radiates through the vacuum of space just like visible light. How fast the gun loses heat depends on the size, shape and material. But as stated in post #46 and others above, heat would also be absorbed from sun and star light, if the gun was not in the shade (behind a planet, a moon, a space ship, the astronaut holding the gun, etc.) The amount of heat absorbed depends on the size, shape, color, material of the gun, and the distance from the sun/stars.
That’s a whole lot of depends. But if you were close to a sun/star, not shaded, and had a black gun, it would heat up to the point where it would not work. If you were in deep space, in the shade, had a sliver gun (that radiated heat like a black body), it would eventually cool off to the point where it would not work. I suspect there are lots of situations in between where a decently made gun would work just fine. A revolver/bolt/pump gun would work in more situations than an autoloader.