Consider optimizing the number of products further
The book by R. Winkler provides the following expresions for 3rd and 4th order Schrieffer–Wolff:
If one utilizes hermiticity, these correspond to 4 and 27 matrix products correspondingly. Pymablock current algorithm requires 7 and 21 products for these orders, which means that the 3rd order is definitely not optimal. The same optimizations that improve 3rd order might also work for higher orders.