encodeBigDecimalNative
The literal to write, which is where the platforms differ: one holds digits, the other holds a number.
The JS BigDecimal already holds the text, so there is nothing to format on the way out.
toPlainString and not toString: the latter switches to scientific notation once the exponent is far enough from the scale, and 1.0E+10 is not a JSON number.