There are several ways to approach this issue and understand the context as to why teams would opt for solutions such as those 3 options in the example you provided. In an application form that my team were designing we had a similar question but unfortunately these forms were processed by legacy systems that had to pass 1 of 3 exact pieces of information for the back end system to process the application and score it. This ultimately ruled out free key input.
We produced a few different options that we ran by users and the one that performed best was asking ‘Do you have children?’ with a yes/no response. If the user returned yes we would progressively disclose a further question to identity how many they had. We found that by asking people upfront how many children they had wasn’t an empathetic approach as it could be uncomfortable for a number of reasons.
It’s always important to understand the context of why certain solutions are the way they are.