Playing Starfield (shit game btw) had me thinking about how you'd actually design a gun for functionality in space infantry combat.
As far as I understand, most guns now would work fine in space, since the propellant has it's own oxidizer. The main issue will come to weight and overheating.
A lot of guns in starfield are caseless, which makes sense if you're trying to save weight- but it makes no sense if we're considering the lack of radiators. In a vacuum, guns would overheat way faster. Ejecting brass shells is actually a great way of helping remove some of that heat. Of course, if you're fighting in orbit then maybe you don't want the hazard of shell casings flying around in the upper atmosphere. Maybe caseless rounds with some sort of water cooling/radiator on the gun, or with the gun integrated into an existing cooling system on your space suit would make sense?