I think the best possible answer to this is the "Notes" section at http://en.cppreference.com/w/cpp/string/basic_string/clear.

Unlike for std::vector::clear, the C++ standard does not explicitly require that capacity is unchanged by this function, but existing implementations do not change capacity.

And if the capacity is unchanged, that would almost certainly mean that no allocation or freeing functions are called. That's probably the best you can do, short of looking at each and every implementation you care about.