It's not mean, but it might be dishonest. While it's not unreasonable to assume someone RPing with you might judge you by your gender (I do, to be honest, but only in so far as vaguely expecting women and men to have certain strengths and interests respective to gender), the terms get foggy when you're enjoying a story but fear they might lose interest if they found out you were x. Maybe they're a little more invested in the RP's elements than they rightly should be, and maybe you're manipulating them based on that. Or maybe they aren't and it doesn't matter, but you don't want to risk it. It's definitely morally questionable, but the only one holding you accountable is you.