This is a straw man to begin with because the building codes are not the issue… the permitting apparatus is.
However, your analysis is simplistic and assumes:
1. The house uses no natural gas (most do)
2. The cost of electricity never goes up (it will in the short term at least)
3. CO2 emissions from wasted energy have no cost (they do)
4. Building energy efficient buildings is way more expensive than the alternatives for new construction (it isn’t)