Have you asked an actual cashier what they think? They handle hundreds of people every day, do you really think they consider it rude if people don't chat them up? You can smile and say hello and thank you with or without headphones. This once again seems like a cultural divide, as a German I'm happy if noone talks to me outside of smiles and hello/goodbye, this might be different in the anglosphere.
> chat them up
You’re conflating intent to chat with the possibility to converse if needed