You need "side effects" to include memory allocation, seg faults, and "significant" amount of computation time (including never terminating). Worse, you need these properties when the program is known to be in an error state.
For a general purpose programming language this means that your toString cannot be a normal function.