from email.header import Header
body = 'Some text'
subject = '\xc2\xbb My Subject'
msg = MIMEText(body, 'plain', 'utf-8')
msg['Subject'] = Header(subject, 'utf-8')
text = msg.as_string()
Encoding of headers in MIMEText