Is it normal to have to poo during masturbation?

Maybe. I'd get a full physical exam and talk with your personal physician about this. At orgasm, different people have a huge range of different side-effects, from sneezing to headaches, to loss of backdoor control. If you're a female, your gynecologist probably knows a lot about this. Good luck.