First, the more practical idea: military population. Rather than just consuming a single colonist to create a no-maintenance unit, I think that creating infantry and other military units should convert a number of regular colonists into military colonists, who would have a separate population bar with a separate capacity (increased with specialty housing like barracks) and still consume food and other resources. To compensate for existing military units, having more military units than your military capacity wouldn't kill those units, only prevent more from being made until more housing was created.
Military units could be "tied" to a particular location, by default the settlement they were created into, and units could be garrisoned into certain buildings like MBTs in War Factories. You could potentially transfer your military units to another settlement if they had housing available and the appropriate tech/settlement levels. Perhaps a similar population/transfer system could be implemented for regular vehicles and there could be garages.
Second, probably impractical, idea: implement a crowding limit for units so that you can't just stack 2000 infantry in a 6x6 square. How much do you think this would slow down pathfinding
@bastecklein?
Small idea: scale all units down to size 6 (for reference, colonists are 4 and current units and buildings are 9.)
Tried this with colonist scale, but it's a bit too small. Some units and buildings would have to be revised to work at this size, but I think it's a pretty good complement to building and colonist scales.