That's also why there are different designs, e.g. in ear, over ear, open over ear, bone conduction, and technologies, e.g. noise cancelling, active noise cancelling, non voice filtering.
Typically there are visuals though, e.g. crossing lights for pedestrian, so the risk from the lack of hearing in a city is quite low IMHO.
FWIW in Belgium you can even legally ride a bike with earphones, which shows the risk is estimated to be very low.
That said, the masses have had noise cancelling earbuds for years at this point and while there definitely are cases of people getting hurt or killed from being unaware of their surroundings, it’s not really been that big a deal.
Firearms have been the leading cause of death for people ages 1-19 since 2020.
I live in a city. Nature for me means the squealing breaks of cars and trucks + people trying to get my attention so I'll take their religious flyer. No thanks.
I've seen people with no earbuds be completely oblivious and almost walk into traffic...