Gunpowder is self oxidizing when ignited. As long as they used a non-evaporating lubricant on the actual mechanical components like graphite, and included a barrel liquid cooling loop, the M2 would operate totally fine in space.
That's why I say you need to provide a closed liquid coolant loop around the barrel that would ve integrated with your ship's heat management system, to replace the air cooling of the barrel.
The development of the M1921 water-cooled machine gun which led to the M2, meant that the initial M2s were, in fact, water-cooled. These weapons were designated Browning Machine Gun, Cal. .50, M2, Water-Cooled, Flexible.
Bullets don’t inherently go up when fired, they go straight out of the barrel, the barrel is just inclined because of the sight alignment. You just realign the sights, this isn’t a difficult problem.
don't come crying to me when your bullets go up so much they do a full loopdeloop and shoot you in the back of your head because you tried to fire them on the moon where there's no gravity
But actually, if you had no gravity acting to change the velocity vector, the bullet would continue in a straight line. If you shot at the horizon it would be like drawing a straight line tangent to a circle. The bullet's not going to end up going in the shooters azimuthal direction, but it sure is going to gain altitude as the curvature of the body peels down way away from the straight line it's flying,
A closed loop wouldn't work probably. You'd need an open loop, or a shit ton of radiators. I guess potentially it could couple to the ground and sink heat into it, but you'd need to be stationary.