Hoodmaps is a service that more generally allows labeling different neighbourhoods and 'areas' of a city. These labels are not primarily focused on 'perceived safety', and the quality greatly differs from city to city, but they can be an useful guide to check when getting acquainted with a city.
Note: The above image is not licensed under the CC license, it's a screenshot from Hoodmaps who holds the copyright to the image.
Link: https://hoodmaps.com/san-francisco-neighborhood-map
It's not likely that Google Maps, Apple Maps or similar apps would ever include a feature to avoid bad neighborhoods, because it could be labeled racist and attract lots of negative publicity.
In addition to doing manual research on dangerous areas of San Francisco, which is pretty easy, there's also an app called Augurisk Now, which should warn the user if they're potentially exposed to crime or natural hazards. YMMV, I've never used the app, just found it now via an article on Forbes.
My favorite place to get on the California Street Cable Car. California Blvd & Van. Ness, it’s a convent walk to the Cable Car Museum.