With #9175 a new feature landed in nightly cargo:
An [env] section in the cargo configuration to pass additional env variables to all program invocations does by cargo.
From the PR:
[env]
FOOBAR = "Apple"
PATH_TO_SOME_TOOL = { value = "bin/tool", relative = true }
USERNAME = { value = "test_user", force = true }
This information is missing in the Cargo Reference/Configuration section.