'module wide' shared function parameters, TLS, dynamic scope emulation

Yes, it will work:

// bar.rs
#![module_local = "foo: HashMap<u32, String>"]
fn use_foo() -> Option<&str> {
    foo.get()
}

// lib.rs
mod bar;