Probably, you can use list comprehensions like
```python
order = max(degree(arg, func) for arg in expr.args)
```