Some stink is unsolvable, but I found that adding white vinegar to my laundry, where the fabric softener would normally go, helps prevent it from forming.
Cheap vodka has helped some set in stink, go buy a big bottle of the cheapest vodka you can find, and soak the gym clothes in it.
Same as the above, this right here is what I’d recommend: vinegar. I actually have been adding vinegar for years to my workout laundry, and there’s been no stink. I can’t use anything like softener or detergents that aren’t “free” and “clear” due to skin allergies, so my options are pretty limited otherwise.
Don't mix the vinegar and baking soda, they just react with each other and cancel out (acid + base do that). I do a cycle with vinegar, the do another cycle with baking soda + detergent, and it works pretty well.
I used to do a lot of jiu jitsu and the gear gets so sweaty and gross beyond belief and it gets a permanent funk. I tried everything to get it out, but here's the distilled formula. Sometimes.. stuff is beyond repair
Use less detergent. Counterintuitive, I know. But this actually made a difference. Something about extra soap staying on clothes and bacteria growing? I always thought more soap = more clean = more clean smell, but this did seem to make a difference. If they instantly stink once they get wet, this could be your issue.
oxiclean odor blaster. Soak the clothes in it as per the directions for a couple hours, then throw a little in the wash.
quarter cup of white vinegar in the fabric softener (more is not better) and an extra rinse after.
Might try the new rinse aids which are similar to vinegar in that they make the rinse acidic but there's no scent to them. We just tried it and they have helped our blankets, towels, and athletic clothes.
I use OdoBan on mine. I put a cup of it in the washing machine when I load my clothes in. It seems to help. For nasty odors, I'll pretreat with it.
I've also had some luck with Cupridyne (which is marked up and sold here as Pooph!, if any of you have seen the infomercials). It's great at getting rid of intractable odors, but it seems to take a LOT to make a noticeable difference.