This is a solved problem really.
Just ship a statically compiled binary for each kernel/cpu (eg: linux/and64, linux/arm64).
That’s what terraform and kubectl do, for example.