You are "saving" allocations, but bloating bytecode with inline functions. Is it worth it?
And if you remove the inline modifier, there will be allocations for lambdas.
Just let the GC do the work.
Inline functions don't all bloat the bytecode. In the example, there's 3 function calls, 3 if/else, and a few local variables introduced.
Using a class would actually lead to more bytecode bloat, I'll let you check that.
Note that I never said to never use a class to return multiple values, I just showed another way, which makes sense in some cases like the one I showed.