log2vis: avoid a number of temporary allocations
I was noticing that the fribidi was the top offender of temporary allocations in a number of programs. This doesn't fix that, but I came across this while looking into it. In most cases we can avoid allocating any temporary allocations based on the utf8 n_chars.