The best way to pass intermediate value to auxiliary functions

Create a struct, you comment

But unpacking a struct takes time.

what is your empirical base for it? If the struct is immutable, then unpacking is basically aliasing a address in the stack and incurs in no runtime penalty (maybe slightly more compilation time). If you struct is mutable each unpacked field is just one pointer de-reference to a value probably already in L1 cache; is your auxiliary function so lightweight that this de-reference is a considerable overhead?

2 Likes