I think you can do these lines much faster by passing the sublists of b to Poly.  For example

```py
>>> a = [1, 2, 3]
>>> Poly(reversed(a), x)
Poly(3*x**2 + 2*x + 1, x, domain='ZZ')
```

The fact that you have to call reversed here probably means that you should just reverse the order that you define the equations in `b`.