Converts the string builder's data to a '\0' terminated string.
Converts the string builder's data to a '\0' terminated string.This function has a time complexity of O(N), with N being the length of the data of the string builder.
Note: The memory for the data returned is malloced, it is the caller's responsibility to free that memory!