Are you an advocate of everyone being forced to drive an electric car?
Every state has building codes. When they change a building code it may require additional cost. Requiring solar would be no different. The one difference than some other new building code is this one would actually result in a saving long term.
In terms of electric cars the market will determine the winners and losers. The eventual winner will be electric cars. Just like eventually driverless cars will be the winner.