convert str input to bytes

StringRefMemoryObject constructor binding specifies bytes as
its input parameter, so we have to convert it.