Did you try to simply make it export EXCLUDES="--exclude=/home/user/restic/sources/excluded\ 3" or export EXCLUDES="--exclude=/home/user/restic/sources/excluded\\ 3"?
Apparently the quotes inside $EXCLUDES are already escaped, which means that they won’t escape anything. I’m not sure whether there’s a way to avoid that.
My understanding here is that $EXCLUDE is substituted in the command line and is then split a whitespace characters (remember that $EXCLUDE is not quoted here).
With shell features probably the only clean way is to use an array:
Your explanation absolutely makes sense, these quotes must already be escaped.
This also makes me understand my above set -x output.
Using arrays or --exclude-file probably is the best idea, which to my surprise works with an array argument passed to a different script/function. Thanks!