Still don't know why, but the compilation is possible only with GNU LD being replaced by LLD linker. For the command from the question to succeed, we need to add --fuse-ld=lld
option:
# clang++-18 --target=x86_64-pc-windows-gnu --std=c++23 ./test.cpp -o ./test.exe --static -lstdc++exp -fuse-ld=lld