Pre-allocate output string/sequences in advance.

For now just guess that the output will have the same (byte) length as the input. This could be more finely tuned per encoding. This should not affect correctness.