Responded to @kasparsd:
There are tools like https://github.com/humbug/php-scoper or https://github.com/coenjacobs/mozart but they don't solve the problem of rewriting the composer.json to exclude the scoped dependencies, for example.
For utility binaries there are now "shim" packages like https://github.com/wp-cli/wp-cli-shim or tools like https://github.com/bamarni/composer-bin-plugin to pull them in into isolated directories.