So it’s not something I, personally, would do. But spontaneous depantsing is something impatient apparently do, otherwise, why the phrase “keep your pants on”?
In other words, where the heck did this seemingly asinine phrase come from? The day when there weren’t enough toilets/bathrooms to go around? From busy wives with really horny husbands? Somebody let me know already. Or else.
I can’t vouch for it, but according to Phrase Origins it is variation of keep your shirt on, referring to the removal of one’s shirt prior to engaging in a fistfight.
There are two similar phrases in Brewer’s Dictionary of Phrase and Fable: keep your hair on and keep your wool on, both meaning “don’t lose your temper”.