Wrong. The wilderness is far safer. Out of my many many wilderness trips, which did involve things like swollen streams and avalanche hazard, maybe a few rattlesnakes lower down - the most dangerous portion of the trip by far always involved the first hour, just getting away from the insane craziness of the freeway, or else above the dense tule fog further inland during the winter. And commuting that every day for forty years, with at least two near-collisions every week, was far more statistically dangerous than walking around in any downtown. Right up until I retired, there were actual cars lane-splitting on the freeway each morning (not just motorcycles), teenagers deliberately running red lights just to impress their buddies, drivers entering the freeway the wrong direction, from the wrong onramp, due to either unlicensed illiteracy or inebriation.
Then it only got worse during the pandemic, with teenagers routinely speeding over 100mph on our freeways, frequently outright racing each other. So I'd be far more afraid of a bear behind a steering wheel than a hungry one out in the woods; but even the bear would probably drive more responsibly than many people around here!
And far as that woman shot near the SF Pier, which got a mountain of rush to judgment publicity, it was proven to be a ricochet accident by someone carelessly picking up a gun in a bag found under a public bench. How it got left there, nobody knows. There are way too many real shootings, now including gang-style restaurant holdups near the beach, which deserve more scrutiny. But I gotta leave soon with my own camera, before the wind picks up at our local beaches.
The biggest risk of fatality at even SF beaches is turning your back on sneaker waves, and getting sucked out into the ocean. Second to that is people getting too close to a cliff edge and slipping off, or else walking around some point in low tide, and getting caught out there by a high tide. That kind of thing is actually commonplace; and the necessity for rescues frequent. But shootings are quite rare indeed. Go somewhere else in SF if you are seeking that kind of experience.