From https://docs.djangoproject.com/en/dev/ref/utils/#django.utils.html.format_html, another option would be to use format_html
which will apply escaping to (unsafe) arguments, similar to the escaping in the Template system.
from django.utils.html import format_html
messages.info(request, format_html("My {} {}", some_text, other_text))