allow fast PyLong unpacking also for small integer types
reduce code duplication in inlined utility function