Bug description:
Largely as a result of mixing the logic for determining the hardware stack limits and for setting the software stack limits, the incorrect hard limit is set for both TSAN and MacOS. MacOS is too low by _PyOS_STACK_MARGIN_BYTES and for TSAN by half the stack size.
Linked PRs