I've gone about this jokingly and seriously.
Someone says something like, to take Andy's, "No, she didn't."
Jokingly, I would put my hand on their shoulder and say, "I'm a 'he', darling. Don't call me a girl, that makes me sad. You wouldn't like me when I'm sad." And I've had people reply to this with laughter and/or freaking out because they don't like to be touched, and I knew this.
Parroting does help, as well as just stopping them if it's long -- I'd usually just wave my hand in the air, but maybe that's a bit effeminate? -- and say "I'm a he, not a she. Work on it tonight for homework."
Or just mention it to them. "Hey, just a quick thing -- do you mind not calling me 'she/her', it makes me really uncomfortable."