What about returning C++ `std::string` here? I don't like much mixing C and C++ strings in API (as it sometimes can lead to unclear ownership and memory leaks)...

Any specific reason for that? (Yeah, I know, the C++ string is more expensive (new copy), but I guess it is a negligible performance issue in this case...)