You might get even less than 5 years of official support if you buy a new Intel Mac now. They're currently beginning the transition to Apple ARM-based processors. As someone who made the mistake of buying a device at the beginning of an Apple CPU transition in the past, I can warn you that we might only get support for the next two macOS releases before they cut us off.
Although some industry pundits expect Apple to support the "newest" legacy Macs for a while, your advice is excellent.
That crossed my mind. I couldn't remember how the PPC to x86 transition was handled. Generally Apple in modern times supports hardware for around 5 years. They may kick support patches and I wouldn't be surprised if future ARM variants of macOS still carry legacy translation up until X point in time.
I can't speak to software support, but the hardware transition was very fast. It was done in a blink. Come to think of it, the software support wasn't exactly great. IIRC the last version to support PPC was OS X 10.5, which was released in 2007 and updated to 10.5.8 in 2009. There might have been some security updates for another year or two (Wikipedia says discontinued in 2011). Recall that back then, Mac OS X was not an annual release so it was more valuable to be able to run the newest version. Chrome was brand new, and Safari was about the only Web browser in widespread use.
Consumer impact was more limited back then, because Mac was a niche (but growing) platform with well under 5% PC market share. The reality is you got about 3.5 years of PPC support once Intel Macs were released in early 2006. Overall, this mattered less because single core G4s weren't exactly "future proof" and by the late 2000s, such Macs were mostly due for replacement anyway. I have an original Mac mini (G4 1.25 GHz) which I haven't turned on in ages, but that thing runs like a slug. It sucked somewhat for those who bought a Power Mac G5 in 2005, but these were not high volume products.
Today, it would matter more because Macs have more market share and for the vast majority of consumers, quad-core Macs of recent vintage are all the CPU they truly "need" for the foreseeable future. In theory, Apple should/could support 2019/2020 Intel Macs for up to 5 years but I wouldn't bet on it. As Apple continues to transition to a "services" provider, they should be less reliant on forced obsolescence practices (as evidenced by generally excellent iOS support for older devices).