I've been experimenting a bit, and it's a bit early to say, but I think there's one thing that prevents headaches (at least in my case), and this is retracting the jaw during (and just after) orgasm.
Something which I notice immediately is that there is less throbbing in the top of the head. And there's also less earpain.
The exact technique I use is:
- relax the jaw so it drops a little (mouth still closed)
- retract the jaw (without extending the neck; only the jaw moves)
- only little force is used; the movement is minimal
But like I said, it's early to say.