Some hats appear to be tuxedos, martinis, or glasses:
...and yet these are called hats, instead of say some broader category such as "party wear" or "novelty disguise" or something.
"Hats" were always loosely defined. See this comment posted by hairboat 5 years ago during Winter Bash 2013:
A "hat" is a loosely defined term for any of a number of items you can wear on your avatar. They are certainly not just hats.
"Hat" here is a synecdoche:
Synecdoche (AKA Metonymy): A part of something is often used for the whole, as when people refer to "head" of cattle or assistants are referred to as "hands".
...synecdoches usually are shorter and sound better; hat's simpler to say than party wear or head gear, et al.