What about the following:
‘org-src-preserve-indentation’ By default, the value is ‘nil’, which
means that code blocks evaluated during export or tangled are
indented according to context, possibly altering leading
sequences of spaces and tab characters in the process. When
non-nil, indentation is relative to left column, and therefore,
not modified during export or tangling. This variable is
especially useful for tangling languages such as Python, in which
whitespace indentation in the output is critical.