Road safety has been the single huge glaring exception to my relaxed autonomous-ed approach. I agree with you that as a hazard, traffic is almost unique in that it offers no scope for allowing minor accidents as learning opportunities. What's more, humans can have no instinctive understanding of the dangers of fast-moving vehicles, unlike most other dangers in our environment. Spending so much time very close to cars can make children blase about the risk. Most kids won't have witnessed a serious accident.
We live on a main road. If my child was to walk outdoors at all without being always in a buggy or on reins, she had to be able to stay away from the road. So I went all-out. I have no idea at all whether my approach would work for you: I'm sure it depends on the child's age and temperament. And it's totally unworkable for anyone who has major commitments outside the home. But anyway, here's what I did. There might be aspects of it which would work for you.
I decided what I was comfortable with - exactly how near the road my toddler could go before I felt nervous about her accidentally wandering or falling into the road - and she had to keep that far back from the road. It happened to be about 18 inches. If she went closer than that, I said "STOP!" in my Voice of Doom. If she failed to stop, or went close to the road again soon after, I used the draconian punishment of carrying her home immediately and not letting her walk outside for 24 hours. There weren't really any discussions about it because she was too young to understand. It made quite an impression on her because it was so different from our usual approach.
Also, when she was tiny I never had her walk in the road or car park but always carried her. I wanted her to develop a strong sense of unease about being in a road or car park. When she was bigger, she invariably had to hold my hand when crossing any road or car park, however deserted it might be. I did let her wander freely on the pavement and take her own risks about being bashed by shop doors or being tripped over by busy pedestrians (frail elderly people excepted) so I don't suppose she felt too restricted by the total ban on walking near or in the road.
It only took a couple of weeks for her to get the hang of it when she was tiny. Then there was no trouble until she was four, when she had a brief spell of carelessness. Being brought home abruptly and kept home reminded her of what she had to do.
Pointing out and inspecting roadkill whenever we saw it was a gruesome but effective reminder that cars can be lethal. I used to explain that animals have great difficulty judging exactly how fast a car is going, or understanding that it can kill them, and that humans find this hard to learn too. This was before the days of YouTube, but if I were doing it today I might show her one of those anti-speeding videos showing the force with which a car strikes a dummy. That would certainly have terrified my child. I don't think there's much else about which I ever deliberately frightened her, but this mattered to me.