When I was 10 years old, my favorite reading material was MAD Magazine. For those of you who don't know, it was (is?) a humor magazine that's somewhat lowbrow, although nothing I read in it in those days was offensive. One of my favorite features was called "Snappy Answers to Stupid Questions." Unfortunately, I can't remember any of the snappy answers I read in MAD more than 40 years ago. But, I've come across gems of snappy answers over the years. These type of retorts serve to defuse potential conflict through humor, a useful skill.
Probably the best snappy answer to a stupid question of all time was voiced by Mohandas ("Mahatma") Gandhi, India's national liberation leader: A journalist once asked him: "What do you think of Western civilisation?" He replied "I think it would be a good idea!" (For those of you who don't understand this, read up on the history of the British Empire).
Another of my favorites comes from Pablo Casals, the famous cellist. When in his 90s, he mentioned that he still played the cello, and someone (another journalist, I think) asked him: "Why are you still practicing at this age?" which is an ageist and clueless remark. Casals replied, "Because I think I'm making progress!"
Obese people have told me that they've had experiences of being in a fast food restaurant when another customer said to them something like "You shouldn't be eating those fries." A standard retort: "It's true I'm fat, but I could lose weight. Unfortunately there's no cure for stupidity/bad manners." (That may not be completely true, as people can learn better manners, but they usually don't).
A sense of humor is considered an important psychological strength by psychotherapists. In fact it is classified as an adaptive defense mechanism.
I've noticed that despite a plethora of comedy on tv and in movies, many people today are taking themselves too seriously, are easily offended, and at the same time are often afraid to use the type of snappy answers I've cited above because they are wary of offending others. But snappy answers can be a way to put people in their place so that you are standing up for yourself without arguing or throwing a temper tantrum. They are more likely to be heard than direct reprimands or lectures.
There are times when it's best to hold one's tongue, such as when dealing with your boss at work. But in most cases it is better for one's mental health to respond to offensive remarks. Practice some snappy answers to the type of insults that you encounter so you'll be prepared for the next time.
Addendum 7/15: And for my patients who work in media, I found the following: