How do i delete certain characters from a string in Python 3 ?

I wrote this line of code: database = {"host":host, "user":user, "password":password, "db":db, "charser":charset, "cursorclass":cursorclass}

and i'm receiving this: {'host': '35.234.92.142', 'user': "b'freedbtech_'", 'password': "b''", 'db': "b'freedbtech_cursopython'", 'charset': 'utf8mb4', 'cursorclass': "<class 'pymysql.cursors.'>}

i need to remove those "b's" and " ' " in the strings, but i don't know how to do that, i was writing line to line to the document with this code:

save_changes_archive.write(host + "\n")
    save_changes_archive.write(user + "\n")
    save_changes_archive.write(password + "\n")
    save_changes_archive.write(db + "\n")
    save_changes_archive.write(charset + "\n")
    save_changes_archive.write(cursorclass + "\n")

but the same happened. How can i remove it without changing the data i need to use?