MAINT trim away >10 kLOC of generated C code

Trimmed away some dead code and used lower-level APIs were it didn't hurt readability. This is intended to get smaller code, not extra speed, and the generated C code is <del>hundreds of</del> more than 10.000 lines shorter.
What I mean that `object x` vs. `{{VALUE_T}} x` makes the `x != 0` comparison below be done on Python side.
Not sure if that matters much for performance, given that Python list manipulation is probably slow.