This gets trotted out again and again even though it doesn't apply to the kind of price gouging we saw at the beginning of the pandemic. It wasn't 3M raising prices, it was third parties buying up supply in bulk and then reselling at a higher price. This has no impact on supply, because the manufacturer is not seeing any increase in profit margin - it's all going to parasitic rent seekers in the middle.
Don't make the mistake of ignoring physical reality when talking about economy. A market isn't just a list of prices. Behind those numbers are real goods that exchange hands and have to be produced. If you just play around with some numbers you don't change anything about reality. Government price controls such as minimum wages or maximum prices for goods are just that: Playing with numbers. Since the government absolves itself of the consequences of its policies it can promise the moon and get away with causing pain and suffering.
If you really want a solution then you should start by enacting a policy that combines both the physical and economical world and sets the right incentives. Instead of a minimum wage have a job guarantee, instead of enforcing a maximum price on private sellers have a commodity guarantee that you will sell and produce masks at a fixed price. Once you fix the physical world the economical portion will fix itself.
Direct to consumer sales are a relatively new thing. Retailers and other middlemen are still the overwhelming majority of volume for stuff like masks, toilet paper, soap. Or do you buy toilet paper online straight from the manufacturer?
Btw, in a country without significant manufacturing capacity, everyone importing the needed goods is a "parasitic rent seeker".
On the other hand, if you are talking about hospitals and other institutional buyers, from what I've seen, it was mostly US based institutions and companies outbidding everyone else. Are you saying that you would have preferred those masks, respirators or ventilators remained in China or the EU?
Here is an interesting podcast episode about this phenomenon in an area hit by a hurricane: https://www.econtalk.org/munger-on-price-gouging/
This is also what happened in a number of European countries due to the pandemic.