How to pass vanilla python object to objmode section?

Since passing python objects through nopython code into objmode section via parameters is not supported (As explained in topic 131, which this forum doesn’t let me link to for some reason), I tried to pass the state via threading.local:

import threading
import numba

tls = threading.local()
tls.message = 'Hello!'

@numba.njit
def f():
    with numba.objmode():
        print(tls.message)

However this fails, because apparently numba tries to pickle tls (why!?) which isn’t picklable:

LoweringError: Failed in nopython mode pipeline (step: Handle with contexts)
Failed in nopython mode pipeline (step: native lowering)
cannot pickle ‘_thread._local’ object

How do I pass any interpreter state into objmode section then?