[RFC] Little by little add 'const' were possible: mbyte.c (rebase of #268)

Reapplied the changes from #268 to the current codebase.