A popular folk origin for the shape of hamantaschen eaten during Purim is that Haman wore a hat in that shape. I find this explanation unsatisfying, particularly as I have a hard time believing they eore hats like that in the Persian Empire during that period. Is there any evidence for hats of this shape then? And is there a mire likely etymology for hamantaschen?
First, it's important to distinguish between the origin of the snack and its etymology. While there's a thing floating around that Haman wore a tricorner hat and that has to do with Hamentashen, the name of the snack generally is not based on a hat. "Hamentashen" means "Haman-pockets". The name in Hebrew is "oznei-haman", "Haman's ears". It's also fun to point out the wide variety in names for the pastry.
In terms of the origin, a more likely candidate is that it's simply a tasty pastry that was attached to Purim through a pun. "Mon" in Yiddish (and German) means poppy seeds and "tash" means a bag or a pocket, so a "montash" is a poppy-pocket, a totally normal name for a poppy-filled pastry. And "hamantash", making it a Purim-based pun, would be well within the spirit of Purim, namely jovial jokes and eating tasty foods. The earliest references to a Purim-pastry have names involving Haman's Ears, so presumably the pun name came after the pastry. But this is mostly speculation, and not really verifiable.
The references to Haman having a three-cornered hat are quite late, within the last few hundred years. It is unlikely that this represents a wholly unwritten tradition of tricorner hats, preserved only in the Jewish world. The origin of this could be from a Northern European triangular pastry called "Napoleon's hat", which might indicate anti-Napoleonic sentiments in the pastry traditions of Eastern European Jews (if they were associating Napoleon with Haman), but this also is really unproveable.