A wrapper class if you want, a wrapper type with methods / dedicated functions. Still, seems pretty ergonomic to me. Yeah we went from one line to three, but the three lines guarantee safety whereas the one doesn't so?
Also I'm not sure the token count is very relevant for an Anthropic employee who just spent 165k worth of token rewriting the whole thing in Rust. Sprinkling a few defers here and there and swapping types surely would have been immensely cheaper in tokens.
You're failing to distinguish between token count spent and context window used.
You're correct that the former is not a concern for Anthropic, but it's also not the problem I'm pointing out.
The actual is not token count, it's context window. Your context window is finite, and every token you add to it reduces the model's accuracy during inference.