Depends on the reason you need to request gender, but for in-app pronoun purposes, I'd do:
[ ] male
[ ] female
[ ] non-binary
[text box for other]
And use "they" pronouns for the last two options.(Ideally you'd allow the user to specify the pronouns themselves, but even among people who use non-conventional pronouns, getting them to correctly enter the subject/object/possessive cases of their choice is heavily hit or miss)