The DOCKER_BUILD_CACHE_ARG env var holds the options on how to use cache providers. Storing the image layers is useful for the Cirrus cache provider, because it offers 10GB per runner (https://cirrus-runners.app/setup/#speeding-up-the-cache). The cached image layers can help to avoid issues when the upstream package manager infra (apt native, apt llvm, pip, apk, git clone, …) has outages or network issues.
However, on the GitHub Actions cache provider, a total cache of 10GB is offered for the whole repo. This cache must be shared with the depends cache, and the ccache, as well as the previous releases cache. So it is already full and trying to put the docker build layers into it will lead to an overflow.
Fix it by only writing to the docker cache on Cirrus.
Also, DOCKER_BUILD_CACHE_ARG requires a shellcheck disable=SC2086 on the full build command. Fix that as well by using shlex.split from Python on just this variable.