_pdl_ops_ext, _structured_transform_ops_ext, _loop_transform_ops_ext, and _transform_ops_ext have some useful factory functions for attributes. This diff migrates them to use the register_attribute_builder mechanism, which simultaneously has the effect of cleaning up the existing code and making them available for downstream users of the python bindings.
I also ran black | yapf on the scripts to make them more readable.
the "correct" way to do mutable args in python