sim: Get rid of the non-const serialize() method