Long cyrillic names give error Data too long for column sort_name when saving a contact
See also stackexchange post.
The problem is that CRM_Contact_BAO_Contact::add tries to truncate the sort_name and assumes 1 byte per char. While using substr() instead of mb_substr() would get the number of chars wrong, possibly exceeding the byte length, the main problem is that it can truncate half a character creating an invalid utf8 string. This isn't a utf8 vs utf8mb4 thing either.