I figured it out. The culprit is this line at the beginning of /usr/bin/tce:
trap 'echo && exit 1 1>&2' 1 2 15
If for any reason the terminal in which tce is running is closed, then the tce script receives SIGHUP (signal 1). The problem is that once the terminal is closed, the echo command fails because there is no stdout connected to the script. Script seems to enter an endless loop, driving CPU usage way up.
Fix is to simply change the line above to this, which allows the script to exit when it receives SIGHUP, regardless of whether echo succeeds or not:
trap 'echo; exit 1 1>&2' 1 2 15
I will submit a pull request on Github. Issue is solved.