What is a practical use-case for `#defined`?

As title says.

Tbh I can think of a few use-cases (such as ‘optional extensibility’ where you could create a few functions with specific names and the source code can pick up on that, but this isn’t working working atm. Whenever I check when #defined(otherpkg.procedure_that_exists) { } on a proc in a different package, it always returns false.

Is this only allowed for same package?

It’s mostly for bodges. As much as that pains me to say, but exists for that reason. It’s a pragmatic rationale for the rare edge-cases and not necessarily something you should ever use if have the option to never use it.