Avoid unnecessary (re-)allocations in the lexer
Avoid unnecessary heap allocations in the metadata ty decoder
tydecode: Accept a plain borrowed pointer to the data
Lexer: Avoid unnecessary allocations
TypeChecker: Avoid unnecessary copies
Remove some unnecessary closures
Avoid unnecessary allocations in the metadata decoder
auto merge of #7004 : dotdash/rust/allocs, r=thestinger

This removes some unnecessary allocations in the lexer, the typechecker and the metadata decoder. Reduces the time spent in the parsing and typechecking passes by about 10% for me.