Refactoring initialization function for basic_string_t.