Its about tradeoffs.
If you have limited budget you either have to give up at least one of the things ;
1. Security (won't be that bad in the daytime but definitely not in the night time)
2. Nightlife/Restaurant (you may live in more 'boring' place)
3. Access to public transit (do you have a car? Or can spend money on uber? Or take forever ride on MUNI?)
4. Privacy (have a roommate/sleep in bunk bed)
Or... Be incredibly lucky (often comes with social connections in the area.)
People say that tenderloin is bad and that's right its bad. But is also quite centrally located, close to public transit and SOMA (where all the startup offices are) and in the process of gentrification - there are some startup houses and people there so I don't think its the (absolute) worst. There is even a hostel there... So probably you can give it a try.
The absolute worst area in SF is BayView/Hunters Point that has high crime rate, radioactivitiy(the govt used to dump radioactive waste in the area, no joke), lack of groceries and public transit.
For startup founders, networks and accessibility to resources are the most important ones... But of course you cannot ignore your sense of well-being.