Myth vs Reality
That's a coincidence, not a design goal.
The hollow center exists to create an airway safety feature and to enable the candy-anchoring manufacturing process. The whistle thing is an accidental side effect. No candy manufacturer designed a lollipop stick as a musical instrument.



