I spend a decent amount of time in SF and don't find it particularly unsafe (for a 40-ish woman). Definitely a little subjectively more sketchy than most places I frequent in NYC, but there just isn't any reason to be there, so nobody is there. That is kind of how that stuff goes.
People always seem to make things about crime, but I think overreaction is what killed retail. I went to Safeway to buy some toothpast and I had to have an employee pick out the toothpaste and escort me to the front of the store to buy it. I wanted to buy more stuff, but the employee didn't seem that interested in obliging that, so I just got everything else on Amazon and made a note to not visit again. That's why retail is dead. It's not bike lanes. It's not crime. It's that it sucks.