Related to this question but more closely related to this question.
How can I get my PCs to not cause a single or small handful of characters to become the butt of a joke when that humor could easily decrease their survival rate and/or quality of life? I'm not interested in making them take the entire game seriously, nor the whole plot, and not even every character. Just some obvious ones like the constable with a hair trigger or the irate wizard with a short fuse.
I'd like solutions that help prevent this instead of ones that mete out consequences as that's my default and it appears to result in hurt feelings. Note that I'm not interested in overall campaign or mood settings nor am I interested in warning the PCs out-of-game that "this sheriff will put them in the barracks should his scalp be violated by any of their knuckles." I want in-game ways to discourage this.