Nice find unclemac! What Matt said, exactly. From the late 19 century through the early 20th, women carried or used these long hat pins, yes because of their long hair but also for self protection. Sex trafficking is not just a modern problem but was rampant in the 1900s. Women traveling alone were likely to be either pestered or accosted and these things could be pulled out of her hair and readily used to tickle somebody's innards if necessary. The assailant would usually limp off and die somewhere else from the contaminates on the pin or she would have the chance to run away. That would be no small feat with those long heavy skirts. Who knows, perhaps this one hit a rib?
Best wishes!