Making all drugs legal and available (with quality assurance) will (at least help) solve the problem you are talking about, but will at the same time create whole new problems that more and easier access to drugs will mean more people try and use them and then an increase in lives destroyed through addiction (and related consequences). My opinion is that would be worse.
Dance Safe sets up tents at big festivals to do this kind of testing as a harm reduction service. They (and others) are trying to normalize the step of testing what you have before using it, and I think that’s a wise choice especially with fentanyl in the mix. I’d expect that with decriminalized use of “white powder” drugs, you’d see these kits become more readily available from smoke shops, maybe even pharmacies, instead of being something you have to search for online.
It wouldn’t surprise me if a large number of fentanyl overdoses were by people who had no idea they were taking fentanyl at all.