String handling optimizations

Recommended optimizations for the c++ interface:
1. Take std::string arguments by const reference to avoid the copies associated with pass-by-value.
2. Store strings as std::string instead of allocating and copying into a raw string. If the string is short, the standard library will avoid heap allocation altogether (see Small String Optimization).

The first patch converts the c interface to use const char* so they can accept std::string::c_str().