The people conducting studies select the people for the study. If they don't have enough subjects, the study could be considered "inconclusive". So the people conducting the study consider it valid without a representative sample is not doing a good job. Specially if they don't acknowledge that the sample is biased.
Yes, it is discrimination. But it sound as if you are looking really hard for any excuse to claim there is no discrimination. To the point of making up things.
If I want that the studies improve, what we need to do is to point out how a biased study is not complete or not valid for a population not represented in the sample. Thus, forcing pharmaceuticals to invest in better studies.
The real reason they usually don't select women to test new meds is because hormones make it more difficult to get the results they want. They would probably need to improve the formula and that would cost them money.
The fact is that women do experience the side effects when doctors give recipes with them without having been tested. And doctors are unaware of those side effects because they haven't been identified during the test phase. So it is clear that you have completelly missed the point. Unsurpirsingly, I might add.