ByteaTextToByteArray conversion optimization

Hi Francisco,

I have updated my local repo to the upstream and then inserted my changes.
As I don't have much experience working with github, please tell me if I did it right or not, and you can merge this PR.

As you can see I also used #ifdef directive, which is called UNSAFE.

All the best,
Max