Issue 3223:degree((x+1)**10000) takes too long

https://code.google.com/p/sympy/issues/detail?id=3223
sympy.polys.polytools.degree(f, *gens, **args) rewritten in the way described in the thread.