In secp256k1_musig_pubkey_agg, secp256k1_ecmult_multi_var is called with a NULL scratch space. Without a scratch space, secp256k1_ecmult_multi_var falls back to secp256k1_ecmult_multi_simple_var, which evaluates each public key scalar multiplication individually in a serial loop with up to 129 point doublings per signer.
This patch addresses the TODO in secp256k1_musig_pubkey_agg by allocating a temporary scratch space sized for Strauss (or Pippenger when n_pubkeys exceeds ECMULT_PIPPENGER_THRESHOLD). By providing the scratch buffer, secp256k1_ecmult_multi_var executes multi-scalar multiplication sharing the point doubling loop across the entire signer set.
In local benchmarks on x86_64, this cuts pubkey aggregation cycles by roughly 34% for 4 signers (274k vs 416k cycles), 57% for 16 signers (998k vs 2.37M cycles), and 58% for 128 signers (7.27M vs 17.39M cycles, saving over 10M cycles per call). All existing MuSig2 test vectors and module tests pass.