How do you go about defining gender roles in your setting, while keeping with the caveat that all players must still have fun?
Same way I develop anything else about the campaign. I ask "who does what?" and "why?". The same applies when setting up a social heirarchy or caste system, religious and arcane social roles, government structures, and so on.
With every culture, I always try to drop in one or two obvious differences from the norm, and at least one mystery. (To quickly and easily protray the culture, and draw the players into the setting, respectively.) These are not necessarily to do with social roles, of course - perhaps one nation has a taboo against eating in public.
However, the base area will typically be fairly vanilla - in my experience players won't read large amounts of background material, so it's generally best to start with The Kingdom of Generica, and work outwards from there.
What areas are off-limits, and where are good starting grounds? Assume that it's a "soft" limit, meaning female PCs can cross those lines should they wish, but will stand out.
Off-limits areas are anything that will make the players at the table uncomfortable, or that will require excessive explanation to a "likely onlooker". (So, for example, if we're playing in a public location, any sort of racial insult is simply barred. On the other hand, if we only ever play in private locations, that may not be the case.)
The two big no-nos are the two that have just had the new moderation policy put in place.
Likely starting areas are ownership of property, education levels, labour-intensive jobs, religious practice, military service and command, marriage rights (and the place of children born out of wedlock), inheritance, and so on.
What about having feats that are restricted to one gender?
Sort of. I have no problem with a particular deity accepting only women (or men) as priests. I also have no problem with organisations (and prestige classes tied to organisations) being limited to women.
I'm much less keen on 'generic' prestige classes being tied to a particular gender (the Mystic Theurge, for example). If these aren't tied to a "setting element", I don't think the rules should differentiate.
As regards feats, I don't like them being tied to
gender. However, I don't think it's unreasonable for them to be tied to a
prestige class that is itself tied to gender. (I'm actually not a fan of tying feats to classes, but since that battle was lost even with the 3.0e PHB...)
Basically, I see feats as a 'trick' the character can learn. Therefore, unless it's simply impossible for the character to learn it, I don't think there should be a restriction. (Skill Focus: Heal is a good example. While it may be
very rare for a male character to learn it, should it really be
literally impossible? I don't think so. YMMV, of course. And yes, that means that in the one-in-a-million exception case, I do believe a human should probably be able to learn an elf-only feat if they can somehow get the training required.)