The representation of vec was hard-coded in before, likewise absence of comments, so I don't think this makes it worse (I agree it is terrible, though). I didn't look too closely at the alloc/dealloc side of things, but my impression was that all allocation happened on the Rust side so we should be OK.

TBH, I don't want to get into implementing a good solution here, I'd be happy to either take this all back out or to put it into a separate commit.