I'm going to be honest I don't know SF at all. But sometimes their are safer more direct routes through a bad area. Personally I'd never be on a bike past 1 or maybe 2 am. That's when the first groups of drunks get thrown out of bars and start driving.