# mhchem creates an infinite loop, never finishes

I have a document with mhchem and the compile process never ends. What is causing this? How can I fix this?

\documentclass{report}
\usepackage[version=4]{mhchem}
\begin{document}
\ce{H2O + 💩}

\end{document}


This can occur when you have a "strange" character in your \ce' equation that mhchem does not know. mhchem throws an error in that case.
Unfortunately, up to v4.04 (which seems to be included in TeX Live 2016, from reports I get) there was a bug, causing an infinite loop of Unexpected input character when running in nonstop mode, as is the case when compiling within TeX editors.
You can see the error when running pdflatex <yourfile>` (or equivalent) from the command line.