And today's lesson from Moffat-World... (Mental) Rape is funny.
How did you get there? Memory erasure is a common enough SF trope -- consider the Men in Black's neuralyzers, or the ST:TNG crew erasing memories to preserve the Prime Directive, or Professor X wiping bystanders' memories of the X-Men's presence. I don't think I've seen it likened to rape before. Sure, I can see how a rapist could
exploit something like that, but that doesn't mean that applies to every use of it.
And I don't think the idea is for the Doctor's willingness to wipe people's memories to be funny. I think it's meant to be dark, to show how he's changed. What's funny is Strax bungling it so that he takes the hit instead of Clara.