CLN: assorted, mostly typing
diff_2d no longer needs to be in the pxi.in file, so moved it to the pyx

A couple of recently-identified bugs in the groupby code are caused by passing incorrect types, so im getting more motivated to add annotations in/around the affected code.