To clarify, according to the FSF's legal counsel, if you interact with a
program that is forked into a separate address space, then its license can be chosen independently of yours. However, if you link dynamically to a library and share data structures with it, then you are a derived work of that library and are constrained by its license.
(For example, PyCall invokes Python by linking dynamically to libpython and sharing data structures with it, so we are constrained by Python's license. However, since the CPython license is a permissive BSD-like license, it's not really a constraint.)
Ultimately, these questions of when something counts legally as a "derived work" of something else (and hence is constrained by its license) cannot be resolved except by a court, because they are determined by copyright law and not by the license itself. But the FSF's interpretation of the GPL seems to have held up over many years, and hence is a good standard to follow.