Bitcode[1] would’ve been a good way to handle that, if Apple had ever supported it for Mac apps in addition to their other platforms.
1. https://thenextweb.com/apple/2015/06/17/apples-biggest-devel...
1. https://thenextweb.com/apple/2015/06/17/apples-biggest-devel...
https://lists.llvm.org/pipermail/llvm-dev/2011-October/04372... is still my go-to pointer for the portability of LLVM IR (and bitcode); I don't know how Apple have dealt with the instability between LLVM releases of bitcode, but there's certainly plenty of potentially shortcomings if you want to compile for a different architecture.
But they'd probably use it as an incentive to drive stuff further towards the app store.