Maybe such laws shouldn’t be retroactive, or, ex post facto, but apply to new construction only.
As an example, an older home might have exposed knob and post wiring for electricity. Generally it is OK to maintain the components, from an electrical code perspective but no new home construction may be constructed this way.
Excellent point.