Fix "::::" appearing in module_path!()

Closes #18859