>In your example there's no guarantee that the length will be accurate, or that the data hasn't been modified independently elsewhere in the program.
And having a special data-and-length type would make these guarantees... how? You're ultimately going to need to be able to create these objects from bare data and length somehow, so it's a case of garbage-in-garbage-out.