I didn't look into your code implementation. So can't comment on that.
Consumption doesn't matter for main base, because of the point above.
Consumption does (might?) matter for outposts.
Even though many people use energy mods, not all do. (ie: I have only 2 game-changing mods: electric trains and this one. I do not use electric trains per se though.)