I'm sorry but when the sums are that astronomical it really is a rounding error - especially for a home improvement that saves the homeowner money in the long term. If someone can't afford $630k they almost certainly couldn't afford the $600k it would've cost otherwise.
Like I mentioned above, because of space constraints the Bay Area has little choice but to densify if it wants to add significant new housing, and the new regs wouldn't apply to buildings taller than 3 stories.
Things like parking minimums, low-density zoning, and fragmentation of public transit have done and continue to do, most of the damage to housing affordability. Requiring solar is peanuts in comparison and has otherwise beneficial effects also - namely, reduction of carbon emissions.
[1] median list price from https://www.zillow.com/ca/home-values/
It doesn't apply to new construction over 3 stories. Especially for the Bay Area, building up seems like the only way out of the current morass, so is it really that clear-cut?
Also most of the house price in high-demand areas is the land cost. $30k sounds like a lot but is less than 5% of the median house price. People pay that much over asking quite regularly.