You are right that as there is currently no consideration about when a unit is accessed, this would likely cause huge slowdowns and that despite being a huge effort in implementing it.I'm not saying there's not some things I believe I can do, just saying that what you are suggesting, basically a relocating of unit data - a sort of caching - is light years beyond my understanding and I cannot imagine it would not create massive slowdowns as the game stores and restores units with great regularity, even if just to check the potential threats around a given unit, or calculate what unit would be best to attack with in a 200 unit stack.
The reduction of the amount of memory used up by units is definitely the low hanging fruit here. As a first step you could check if a lot of the ints in there actually need to be ints or if they can be shorter (might need pragma pack to get an actual result). Or you could pack bools into bits. Especially if they are rarely accessed so the potentially slower access matters less.To me, it seems the only real solution would be to improve the method of storing some variables and doing all we can to cut down on how many variables are in use and try to identify some variables that never need to be initialized for some units by their type. All that alone is a mega project in itself. And the crappy thing is, work like this is completely unnoticeable because it adds nothing to the game but a little more wiggle room for it to continue past where resources are pushed to the limit.
Then you could split off more of the data that tends to be the default value for most units into one or more separate structs similar to how the keyed infos are done (e.g. info that is only used for a specific type of unit).
Another optimization possibility is that a lot of those structs that can be split off have the same value for a lot of units (as the value comes from the unit type and maybe a promotion or two). It is possible to store that value in a map as key with a reference count as value (so you can delete it if it is no more referenced) as then a simple pointer to that map entry can be stored in the unit itself. The difficulty about that is that you cannot simply change the value in there then but instead each time you change something in that struct for one unit you have to create a new separate entry (potentially deleting the old one). This would not be that great currently as there are a lot of changes to single values while the unit is created.