I have endometriosis and my period is so bad I get in a sort of delirious state, quite aside from the pain, need to pee every 10 mins, ditto bowel movements, all whilst shivering uncontrollably and occasionally vomiting. This is with painkillers.
So no, I can't just work through it! Also notice I am more weepy/less productive right before my period. However, I also notice a surge in creativity, drive, energy etc, mid-cycle ish. So I think if you averaged out my performance over the month it would add up fine.
I think we are looking at it the wrong way, through the lens of a male-dominated world. Was talking to a male friend ages ago about the idea of "period leave" and he said it would be unproductive. Well, it's unproductive that people have to stop to eat and sleep and things, but we accept those as normal bodily functions without (much!) question. Because men (aka "normal people"/the default) have those functions too. If the world was historically and currently female-dominated, we'd have the monthly cycles built in to our idea of a working life, just as loo breaks and shift patterns are now.
And if hormones wax and wane in such a way as to alter performance throughout the month, it stands to reason that there must be better times as well as worse times. But we are framing the worse times as deviating from the norm, and a problem... rather than framing the super-productive time of the month as an asset. (Struggling to put this into words!))