There is a long and storied history of whistles for protection. Ancient Egyptian guards used to place a blade of grass between the thumbs to alert other guards of issues that were transpiring. Later, shells were used to the same end. In China, acorns with holes drilled in them were used similarly.
As a dedicated instrument, whistles have been made of wood, bone, metal, and later, plastics. British bobbies have used whistles to communicate over distances since the 1880s. They are a commonly used tool for boatswains, crossing guards, and referees.
I wish I knew more about rape whistles, but they seem similar in functionality to hikers taking whistles with them in case of injury, as the sound carries much further than yelling, and is much less tiring.
As someone regularly stalked by a large creepy harasser, I am grateful for the whistle I was given for self-protection, even if the creeps who it was given to defend against resent the fuck out of it.
Fin.