C++ functions matching the interface and behavior of python string methods with std::string