There's single str_index_to_ptr() function, called for both bytes and unicode objects, so should handle each properly.