try a place in oakland. you can take a train into SF cheap.
In SF, I would avoid the Tenderloin, parts of SOMA from 6th Ave and higher, Mission district below 20th Ave, Excelsior, and Hunter's Point as well as the Bayview neighborhoods. Avoid East Palo Alto in south bay (the rest of Palo Alto is quite safe).
For short-term housing, this could be a good option if your budget is ~$1000/month: Berkeley is generally quite safe https://och.berkeley.edu/housing-secondary/price-under+1100/...