The other day I paid with a $20 bill and two ones for a $12 item so I can get a whole $10 back instead of more ones. The cashier mindlessly saw the $20 as a $10 because it’s so exceedingly rare for someone to intentionally overpay to control excess change. After that, I stopped doing it.
Back in the day you did the math in your head and gave back change. If there’s a line, it’s easier and faster for you to pay a few cents extra so that the cashier can give you back a single nickel instead of multiple pennies. This is really about how many physical actions you need to take.
Just FYI you can look up stuff like this at no cost. It's not even close to being true. A Canadian polymer banknote costs about 20 cents to manufacture and the smallest denomination is $5. Coins cost a few cents to make (even $2 ones). It's just the penny that lost so much of its value over time that it costs more to make than its worth.
Well except that if you are doing it with cards you have to worry about being skimmed. Here in Canada they have chip and pin but guess who gets stung with purchases 4 out of 5 times when it happens because it doesn't ask for the pin all the time.
Now if you do it through a smartwatch, phone, or some other device that can't be skimmed when it isn't being used, then that is the way to do it.