A lot of modern cars have an automatic brake that keeps your car from going downhill in those situations. Some are smoother, some are weirder, but it works.
Generically, that's called a hill holder, and there were pre-electronic implementations. My 1986 Subaru BRAT had one. I can't speak to how it was to drive; it never worked. The hill holder specifically, the rest of the car mostly worked.