py: Use str_to_int function in more places to reduce code size.