IIRC, Toronto in the 70’s was famous for the gay Halloween parade (from one gay bar to another). The logic of the parade (admittedly, mostly word of mouth although I think I read it in a newspaper too) was that it was the one day “dressing up” was legal since it was an accepted custom to wear costumes on Halloween.
The rest of the time, the charge was “wearing a disguise”. This was a charge that could be laid against someone who disguised their appearance, usually to avoid identification during a crime. It was fairly broad (sorry) so not just ski masks or lone ranger masks, but fake mustaches, wigs, etc. would qualify. Of course, you did not have to actually commit a crime. Often, like “possession of burglary tools” it was something the police could lay if they caught you before the actual crime.
Presumably the macho police of the time were not above using the system for gay-bashing to harass someone wanting to enjoy their lifestyle. They evetually were raked over the coals for standing by during egg-throwing and other gay-bashing during one Halloween parade in the 1980’s IIRC, and since then have enforced the laws to protect the parade.
Then there’s the practical consideration - you could likely be charged as a perv for using the wrong public toilet too while dressed up.