I get so messed up during my period when it comes to well, pooping, not to be gross. I get constipation AND diareaha. People act like I'm crazy saying how can you get constipation and diareaha, but usually in the days leading up to it, I'll be constipated, and then during, I'll have loose stools or even the runs. It's just so miserable . Or, when it's during, & it's not diareha, it'll be these sudden painful urges to go to the bathroom. Sometimes to the point where it feels like you're being stabbed, worse than just normal gas pains,& I practically have to run to the bathroom, & I go alot. Not to be gross but this one time recently, I swear, every time I went & thought it was over, I'd start to pull my pants up & would have to go again . Why does this happen? I don't really eat much differently during my period. And it didn't used to happen when I was younger. Maybe I'd get the occasional bout of diareha but just very seldom. As I've gotten older, its every single period.
It's to do with the hormones in your body being produced in excess This happens to me as well, but not quite as bad as you.
The chemicals that make your uterus expell the blood basically cause mini contractions. Sometimes if your body produces an excess of these chemicals they actually spill over onto the bowels - causing mini contractions there too. And I'm sure you can make the link between contracting bowels and expelling extra poop quicker...
They are called prostaglandins, and this happens to a lot of women. People who produce a lot of excess prostaglandins tend to feel more 'period pain', nausea and as I call them "period shits". They normally have periods that are super-heavy for the first couple of days then really light for like another good amount of time. This is because the body expells most of the blood in the first couple of days, but then there are still excess prostaglandins having an effect on the uterus causing a period to last for quite a long time.
Other things that can affect bowel movements is the painkillers you may take? Most painkiller state diarrhoea as a side effect.
The sharpened gassy pains you describe sound like the bowel contractions, as most people tend to notice these more than uterine contractions during a period.
The only real way to solve this is to find a pill or hormone-based contraceptive and these normally cause the body to think it is pregnant, blocking the production of normal hormones.