San Francisco has been among the hardest-hit cities since the pandemic as office and retail vacancies soar, and concerns about safety deter visitors.