rather than duplicate for Pow and non-Pow case, can all this be handled by 

```
if x.is_Pow:
    b, e = x.as_base_exp()
else:
    b, e = x, S.One
```

followed with what is in the `is_Pow` block?