Hopefully all areas in San Francisco are getting better, but the two neighborhoods you reference are down pretty significantly in price. So the best thing I can say about them is that you can do some serious bargain hunting.... and of course the better the deal, the safer your investment will be 8 years from now.
Overall, I'd imagine crime would not be too dissimilar to Venice... you get to learn which areas you're comfortable in, and which you are not. I'm a former New Yorker, so like you, almost nothing bothers me. But while almost all of SF seems safe to me, the majority of my friends argue otherwise about quite a few areas, and there are parts of Portola I know they'd avoid. But each of the two neighborhoods have a lot to look at, and you really just need to see it for yourself.
HOWEVER, I kind of look at those two areas as "sort of" suburbs to what I'd consider "city living". That may be the New Yorker in me.... SF seems like a tiny town.... but when areas like Portola and Excelsior are mostly Single Family Homes and not condos or multi-unit buildings of some kind, I don't really associate them with "city living". LA is more spread out, so you may feel differently. But if you really want the "city", on one extreme are the areas where all of the new construction is going on.... that's SOMA, South Beach and Mission Bay... quite urban with a lot more construction planned over the coming years.... a bunch of high-rises and mid-rises. Check out 81 Lansing and 555 4th for two of my listings.
Then there are lesser urban areas that I'd consider far more "city" living than Portola or Excelsior.... that includes all northern neighborhoods from North Beach to Russian Hill, to the Marina, Pac Heights, Cow Hollow and Presidio heights.... but if you think LA is expensive... these are probably more so.
More center of our peninsula (SF is a 7x7 area with water on 3 sides) are areas like Hayes Valley and Height Ashbury... definitely more "city" urban, yet some really cool and quaint areas.
Finally, you just might LOVE the Mission District. That is definitely city living, there is amazing night life, it's about as diverse of an area as we have in SF, and there are bargains to be had. It's one of those areas where my mid-western friends get uptight, but I absolutely love it because it reminds me of the NYC I grew up in.... and you might get a little bit of Venice vibe. It really has a lot going on and is very vibrant in all kinds of ways. Check out my home-finding sites at my reference site to get listings for any or all of the above.