$_POST field value gets altered after “init”

Yes, it’s the expected behaviour. There’s information on why it works like this here, and this function which can help in removing slashes from larger data structures: https://developer.wordpress.org/reference/functions/stripslashes_deep/

In the short term, if you can live without JSON for this field, why not just remove it, and if you need multiple hidden fields add them separately, e.g.:

<input type="hidden" name="testId" value="1"/>
<input type="hidden" name="otherId" value="123"/>

And you can get those directly with:

echo $_POST['testId'];
echo $_POST['otherId'];

Will output:

1
123