py: Clean up includes.

Remove unnecessary includes. Add includes that improve portability.
objstr.c: Replace size_t with machine_uint_t.