which coerces the atom to a string. But in my experience, this should be avoided unless the interface really demands that variance. It is better to crash the code and fix it in the caller rather than trying to coerce in the callee. Generally, if you are only accepting a small set of possible erlang terms (i.e., strings), then your code is more robust against sending wrong values. If you coerce/canonicalize terms, you run the risk of converting some value which shouldn't have been and you are now running a program where some data is undesired.
The key is that `my_fun(atom_input)` is a bug in the program. It should be fixed by a programmer, and not saved by the system in an attempt to continue at all cost.