The fact of the matter is, the city politics have been vicious for decades. Credentials for national leadership get manufactured here because the politicians left standing are good at the job(which is quite different from being good for the populace). Tech doesn't make the city exceptional - tech is just a piece of the puzzle, another horse to jockey.
Take the school board, for example. The stories have made headlines: ineptly renaming schools and eliminating selectivity for "woke points" while pandemic-related issues remained unaddressed. Those headlines get made because the board was banking on those actions giving them progressive credentials, not because it was being asked for. They took a huge risk and miscalculated. But what happens if you manuever such things successfully? That makes you a Kamala Harris or Gavin Newsom - in other words, polarizing yet successful on the big stage.
In this light, SF has an up-or-out purpose to its dysfunction: encourage risky moves here and you get savvy statesmen later. It's in the interest of the Democratic Party to keep a machine active here to develop those candidates. However, the party itself is beholden to its biggest donors, so the things it prioritizes and encourages are warped according to financial incentives; the city government now has an ongoing federal investigation precisely because the incentives for politicians to behave and play fair are missing.
And so I would have to conclude that if you want to "save" San Francisco you have think big picture too and work on incentives for the city to generate better policymakers that can clean house. The money incentives automatically create a lean towards dysfunction, and this is a thing occurring on multiple levels of government, not just locally: "If you want to advance you have to do X and not do Y" is going to make X happen and Y not happen.