replace "int" usage by safer "Py_ssize_t" types

Note that these change the inter-module C-API for the exposed extension types.