Replying to myself,
it turns out that if I explicitly import the function from that module, then it works:
from ccb import get_site_data
@st.cache(allow_output_mutation=True)
def get_data(site):
return get_site_data()
Not sure if that is a bug or expected behavior, but it might help someone else.