Thank you for answering a FAQ; I didn’t yet understand how to search for this particular thing in the FAQs.
My example has the recommended structure, just by luck. But now I see that putting everything in main() (or get_dl() as I did), completely prevents the “side effects” I was worried about.   We just have to make sure there are no executable statements outside of main(), and that takes care of it. And also I guess DataLoader needs to import some modules for each worker; that’s why it does the import. Since it is importing a whole script, it might import some things it does not need, but that does no harm.
p.s. I am always glad to see your responses to a question I have searched for; I always learn something from them.