lib/core: Added copy method `to_bytes_with_copy` in Text