The implementation here can be this for now:

MCAutoStringRef t_string;
if (!copyasstringref(&t_string))
  return false;
return MCDataCreateWithBytes(MCStringGetNativeCharPtr(*t_string), MCStringGetLength(*t_string));