When you need to start worrying about memory allocation control, garbage collection latency, pointers, byte padding, and CPU instructions per operation, Go might be not be the best tool for the job anymore. Seems like Rust might be a better choice here? Instead of reverse engineering what the compiler might do, then structuring the code in subtle ways to get the compiler to actually do what you intend to do, why not pick a language that lets you command the compiler do to what you want?
The interface problem seems like something the compiler team should fix or mitigate. I worry this post is going to cause a lot of premature restrictionism.
I noticed there's a go:noescape compiler directive that seems to provide an escape hatch for a lot of this unexpected compiler behaviour:<p><a href="https://golang.org/cmd/compile/#hdr-Compiler_Directives" rel="nofollow">https://golang.org/cmd/compile/#hdr-Compiler_Directives</a><p>Does that actually work?