Nintendo explains why Switch cartridges taste nasty

Yep. Denatonium benzoate is often used in Denatured Alcohol (ethanol) to discourage people from drinking it.

Note, though, that most most formulations contain genuinely poisonous denaturants as well - usually methanol or pyridine, or occasionally acetone or MEK or isopropanol. Something toxic and difficult to remove.

(So I guess that’s “to prevent intentional poisoning”, eh?)