Strictly speaking, its not illegal to ask the question. However, because it is illegal to base hiring decisions on it, asking the question is legally dangerous in two ways:
(1) Asking the question in an employment interview is evidence which can tend to support that you intended to use it in a hiring decision, and
(2) The interviewee answering the question is evidence that you had the information, and thus the opportunity to use it in a hiring decision.
As a result, the usual legal advice is to strictly avoid asking the question: you can’t legally use the response, and by asking it you make yourself unnecessarily vulnerable. The idea that it is illegal to ask the question is probably a consequence of this.
They also tend to ask a lot about things that might sound innocuous, like hobbies.
If I was being stupidly honest, I could talk about my involvement in the furry community. Most furries (~80%) are LGBTQ (versus ~3% to 5% of the base population).
Instead, I make vague allusions to being a gamer. (I play video games less than anyone I know, but it's not zero, so that's still technically true.)
None of this should come up during interviews, but in the tech industry in many or most places you should feel safe mentioning in passing a same-sex significant other or volunteer work with an LGBT group or something like that. Of course bigots can lurk anywhere but if this is really bothering you then, and I mean this with all respect and kindness, that might be something for you to work on personally. That you're worried about Chicago is a sign to me that you might need to recalibrate a little.
Also, questions about hobbies or favorite books or whatever you might be thinking of should be thought of as places to let yourself shine professionally. When they ask about books it might sound like they're open to hearing about your favorite bodice ripper but really it's a chance for you to talk about technical books you like or something else suitably impressive and relevant.