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.
Some people are genetically wired to secrete a permanent athletic stink. If extra detergent and vinegar don’t cut it then there’s not much you can do except replace your clothes.
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.
Vinegar as some people suggested helps. For me, the only thing that got the stink out of my gym stuff was adding Borax to the wash. Did wonders. If you have a washer at your place, try starting a load, let it agitate for a little bit, then pause it until the next day. Also, hanging in the sun and wind helps. But if you only do one, buy some Borax and add it to your load next time. Should make a huge difference.
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.