clean up some unnecessary C-API usages and fix integer sizes

note: integer size fixes which require corresponding changes in itertoolz.pxd