net/netip: reduce allocations in MarshalBinary
net/netip: reduce allocations in MarshalBinary

Addr's MarshalBinary required two allocations in the case of a zone
existing, and AddrPort and Prefix both required three. This refactors
things slightly so that each marshal function only needs a single
allocation.

Change-Id: I9bde9969fedc1cad64bebb607188c4287f6a0d01
Reviewed-on: https://go-review.googlesource.com/c/go/+/361054
Trust: Jason A. Donenfeld <e7e312fea4c2c1aad2bb075d739111890e1ce08b@zx2c4.com>
Run-TryBot: Jason A. Donenfeld <e7e312fea4c2c1aad2bb075d739111890e1ce08b@zx2c4.com>
TryBot-Result: Go Bot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Reviewed-by: Brad Fitzpatrick <ae9783c0b0efc69cd85ab025ddd17aa44cdc4aa5@golang.org>

cloudflare/go,cloudflare/go,golang/go,CAFxX/go,golang/go,cloudflare/go,CAFxX/go,golang/go,CAFxX/go,cloudflare/go,cloudflare/go,nawawi/go,golang/go,nawawi/go,CAFxX/go,nawawi/go,nawawi/go,cloudflare/go,nawawi/go,CAFxX/go,CAFxX/go,golang/go,golang/go,cloudflare/go,nawawi/go,nawawi/go,CAFxX/go,golang/go,nawawi/go,cloudflare/go,golang/go,CAFxX/go