I would definitely see a doctor. I would say maybe your partner(s) are being too rough with you, but you said that even when masturbating, it has to remain external, so yes, book an appointment with your doctor ASAP to figure out what’s going on!
The sooner the better so figure out the problem, fix it, and you can start enjoying sex!