serialize: Remove allocations from escaping strs and indenting spaces