Fix non-portable uses of variadic arguments
The current code happens to work as expected on most architectures, but it relies on non-portable assumptions about variadic calling conventions. This would breaks on architectures that
- don't pass all arguments in registers and are big-endian,
- set bounds on varargs
- or pass pointers in different registers from integers.
An example of an architecture where this breaks is CHERI-extended MIPS. CHERI-MIPS has all of the above properties and therefore crashes at run time.