Add try_encode_bounded: budget-checked single-pass encode entry points (#320)