@elfin in fairness, our legislature usually avoids such stupid measures. But clearly they aren't perfect. Ironically, the state with Silicon Valley doesn't always understand tech-related bills.
I'm getting an API Key at Weather Underground and their Sign In form asks for Gender. Perfect it isn't, but it does include "Other" and "Prefer Not To Say".
@elfin One might follow up to ask why the Weather Underground site needs to know anything about its users' gender identity no matter how they choose to classify it.
The first rule of protecting private data, is not to collect private data you don't have any need for. If you don't have it, it cannot be stolen from you.
I #Drupal land, there is a module for gender that basically just creates a field ... but it's Module Page spends pretty much all of it's tie explaining why you should not do it. It's a good read.