I know I can count the leading spaces in a string with this:
>>> a = \" foo bar baz qua \\n\"
>>> print \"Leading spaces\", len(a) - le
That looks... great to me. Usually I answer "Is X Pythonic?" questions with some functional magic, but I don't feel that approach is appropriate for string manipulation.
If there were a built-in to only return the leading spaces, and the take the len() of that, I'd say go for it- but AFAIK there isn't, and re and other solutions are absolutely overkill.