Perfect elimination ordering and high memory usage
Silly me. The function listify also includes the empty list. Therefore
in each recursion of do_elimination the length of list gets doubled. This
is not bounded by the length of the original list anymore.

All these empty lists get stripped away by concat later.

Acknowledgement: Finding this out would have taken a great deal longer if not for a very kind person who took me by the hand and walked me through it.