People per square foot in SF is pretty dang tight.
Coming to SF from Denmark... I would say there are 3 main issues:
1) traffic laws aren't followed,
2) drivers are poorly trained (drivers license requirements is a joke),
3) roads aren't optimized for safe high-throughput traffic
(1) is what causes danger, but (2) and (3) are the reasons for this. Compared to most European cities SF has wide street, lots of space, and yet manages to spend half the streets on parking, uses stop signs all over, this causes drivers to disgard stop signs, speed up/down like crazy, and it makes everything go slow which in turn makes drivers agitated..
Selecting a few major roads, getting rid of parking and stops signs on those roads would go far (very far). Turn some of the small side roads into parking lots, that you can't drive through, and you would have more parking, less traffic congestion. You don't need all the small side roads, it's okay to drive 4-6 blocks to get one block up hill, reducing the amount of intersections and increasing throughput.