I've heard in reality the opposite was often the problem, with guns freezing, to the extent some weapons had heating jackets on the barrels. Remember as well that the airflow over the barrels would help cooling greatly.
I'm not saying weapons didn't overheat, just that it wouldn't have been anything near as frequently as on the ground.
-Matt
Gun heaters were definitely present on a number of aircraft. I know some Mustangs had them, I'm assuming others did as well.
The biggest issue are the number of factors involved. Here's the major ones that I can think of off the top of my head:
- barrel temperature from altitude, wind chill, gun heater, sustained firing (hot barrels more likely to cause barrel obstruction jams)
- chamber temperature, different from barrel temperature (will cause cookoff)
- Open bolt vs closed bolt action (open will cook off less easily but will runaway if it does, closed bolt will cook off one round but not run away)
- electrical vs percussion priming
- G forces
- charging system, if any (for loading or clearing weapon from cockpit)
All that varies widely between gun types across planes.