encode: reduce allocations in AcceptedEncodings (#7847)