Python 3.7.2
I write the strings from my Python code into my database. My strings contain Latin and Cyrillic characters, so in the database I use 1-byte encoding koi8-r. The miracle is that my strings without distortion are written to the database, although utf8 and koi8r have completely different sequence of characters (for example, as in ascii and utf8). Sometimes characters of other layouts appear in the text and then write errors appear.
Therefore, the question appears:

Who converts strings: the database or the aiomysql library, that I use to write to the database.
How quickly in Python / MariaDB to remove non-koi8-r characters to avoid errors.
Is there a multibyte encoding that stores the Latin and Cyrillic characters in the first byte, and other layouts in other bytes.

Thank you in advance for participating in the conversation.
Here's the processing when INSERTing:

The Client has the characters encoded with charset-1.
You told MySQL that that was the case when you connected or via SET NAMES.
The column that the characters will be inserted into is declared to be charset-2.
The INSERT converts from charset-1 to charset-2.  So, all is well.

Upon SELECTing, the same thing happens, except that the conversion is in the other direction.
What you are doing is OK.  But, going forward, everyone 'should' use UTF-8 characters in clients and CHARACTER SET utf8mb4 for columns.  You will essentially have to change to such if you ever branch out beyond what your character sets allow, which may be nothing more than Russian and English.
Writing from Python to a database with an encoding different from utf8