So I didn't say 'I sanction genital inspections on schoolkids' as you claimed. I said a note from the GP would probably suffice. The doctor would presumably have access to their medical records; no genital inspection required.
The children in question will be boys who identify as girls and whose inclusion in female sports would be unfair to girls.
A PE teacher demanding a note from a medical doctor is akin to sexual assault? Did you never get a note from your mum to say you were on your period and couldn't go swimming? Kids routinely provide notes from doctors to school for everything from needing the toilet a lot to not doing PE because of x, y, or z.
You seem pretty upset about the invasion of privacy and dignity for a boy who identifies as a girl and not at all bothered about the privacy and dignity, or fairness, of the girls who have to compete against, or share changing and showering facilities with them.
Yes, sex testing in sport has always been directed at women because, guess what, there is no advantage to a country to have its female athletes competing in the male class.