Use the (faster) native mb_string functions where available, and fallbacks where not.