If one just wants to test whether a given polynomial $f(x)$ is positive for all real $x$, this can be done without representing $f(x)$ as the sum of squares, using the following function:
def is_pol_positive(f):