When defining RPCHelpMan objects, we usually return a lambda, and mostly we define those via [&](...) { ... } which explicitly captures any parameters or local variables by reference. If we were to actually use any of those captures (we don’t), we would invoke undefined behaviour. So instead, convert all the [&] to [] to avoid capturing, and as part of RPCHelpMan check that the function we provide is convertible to a bare function pointer, so that any attempts to capture anything (even if it’s by-copy, which is safe) results in an error.
While we’re at it, rename RPCHelpMan to RPCMethod, reflecting it’s greater responsibility since #19386.