The crucial difference seems to be this extra space at the end of the last CFLAGS option in the non-debug builds:
build-shared: -fdebug-prefix-map=/home/ubuntu/git/packages/python3.11/python3.11=/usr/src/python3.11-3.11.2-5 "
build-shdebug: -fdebug-prefix-map=/home/ubuntu/git/packages/python3.11/python3.11=/usr/src/python3.11-3.11.2-5"
The crucial difference seems to be this extra space at the end of the last CFLAGS option in the non-debug builds:
build-shared: -fdebug- prefix- map=/home/ ubuntu/ git/packages/ python3. 11/python3. 11=/usr/ src/python3. 11-3.11. 2-5 "
build-shdebug: -fdebug- prefix- map=/home/ ubuntu/ git/packages/ python3. 11/python3. 11=/usr/ src/python3. 11-3.11. 2-5"