Thermochemical wastewater valorization via enhanced microbial toxicity tolerance