utils: allow borrowing a C string

We don't always need our own copy of a C string; sometimes we just need
to parse it. Create py_str_borrow_c_str() which returns a char pointer
to python's internal value string, with which we can avoid an extra copy.
config: borrow the string for lookup and setting

We don't need our own copy of the string, so use the new borrowing
mechanism to use python's underlying string for the key to get/set.
repository: borrow C strings where possible
signature: borrow the name's C string
refspec: borrow the C string
remote: borrow the C string where possible
index entry: avoid extra copy