@timsaucer contributed a unified `AggregateUDF`/`WindowUDF` builder to upstream datafusion: https://github.com/apache/datafusion/pull/11550 We should expose that and leverage that to clean up the `functions.rs` APIs.