There are many avenues for enforcement, including and up to the state taking over the city's land use powers if they are unable to comply with state law. At that point, California could issue permits to build.
There are a lot of friendlies in the California Department of Housing and Community Development (HCD), but NIMBYism tends to attenuate at higher levels of office since you can't simply move externalities outside your jurisdiction. Citywide officeholders in San Francisco itself tend to be pro-development; it's the district officeholders who have bad incentives.