If the validation is done on the Emacs side, then perhaps it would be beneficial to use the json_*_nocheck function alternatives to disable libjannson's validation, namely json_stringn_nocheck and json_object_set_new_nocheck. [1] jansson.readthedocs.io/en/stable/apiref.html#c.json_stringn_nocheck P.S. Would applying the following diff be okay? It's a simple optimization that avoids an overflow check (the sizeof comparison is optimized out even in -O0) in the usual case of a JSON integer fitting into an EMACS_INT.