I think it's important to note:
- the exact laws vary around the world and depend on the jurisdiction
- if you want to know for sure, get proper legal advice - consult a lawyer
Still the easiest answer is - just don't do it. At least one sure-fire way of avoiding copyright infringement is to simply not go down the fan game route at all.
As far as I am aware (as a non-expert, non-lawyer) in some cases companies are required to issue takedown notices, to keep their trademarks valid. For example if you could prove that Nintendo knew about, but did not try to take down, a game using the Mario character, they could lose the rights to use Mario themselves. So they have to come after you. They probably have staff hunting for this kind of thing. This makes it pretty risky to release anything at all, ever. And I think the reddit post is correct in saying that making it free does not change anything.
If you make a game privately and never release it to anyone else ever, I guess you might get away with it. But I think most people eventually want to share what they've made, and I'd guess keeping it private still doesn't make it legal either.
I also think in the community there's an interesting comparison to C2 devs who want their games protected. Lots of users are worried someone will rip off their games, and often ask questions about how to best protect the code & assets, what to do if someone copies your name/character ideas etc. It's funny that so many people in this community are worried about this exact problem happening to them, yet others seemingly defend the whole fan-game idea, which is often doing just that. I don't know if any particular individuals exist who are both worried someone will rip off their game and is also in favour of ripping off other people's games, but it's still interesting that these conflicting views exist in the community.