Unless it's mandated, everyone going for those things should be seeing worse outcomes, e.g. banks discounting fundamentals and including the racial markup of their customers in decisions would be expected to perform worse than others, wouldn't they?
You'd just need to invest into companies that are explicitly not focusing on ESG. Of course, there's probably some concern that it'll be normalized and the government goes "well, now that half of companies are doing it voluntarily, we can just force the other half to also do it so it's fair", but that aside it sounds like it should provide a good signal for you where not to invest.