It don’t think this makes much sense for Julia.
Because of that there is a compiler and a linker step in these languages where in Julia we only have the compiler step. Introducing something like you propose would make a linking step needed so nothing is won for the TTFX problem.
And as soon as you are calling into the code you need to import it and compile it, so actually the compilation is just postponed.
Perhaps what you really want is, that we could only be dependent on a small part of another package. Only of those parts you are using in your own package. This is more about of better design of the package you are dependent of.
Anyways, a syntax for interface/API definition could be something beneficial, e.g. see this discussion: Base.modules_warned_for silently removed in 1.8