Just ask the question differently...
Wrong: "Do you have any kids?"
Right: "Are you able to commit to a fixed rigid work schedule?"
The company doesn't actually care whether the prospect has kids or not. The company cares if the employee will have to take time away from work to attend to kids.
Of course, any company that asks either of those questions is probably one you don't want to work for.