Python Too Many Statically Nested Blocks