Regarding the female category of sports, a sample of cells taken via a cheek swab can be used for karyotype testing, which would be sufficient for screening female athletes. This is much less intrusive than the anti-doping tests - which involve having blood taken and being observed urinating - that for many athletes is a requirement to compete. In the unusual case that the athlete has something other than 46,XX sex chromosomes, further analysis could be done - with the athlete's permission - to understand the underlying condition and, from this, determine eligibility to compete in this category.
No-one is advocating for all female athletes, including children, to undergo genital inspections. It isn't necessary and it's not being asked for.