Can I do this in a more flexible and controllable ways when the number of kwargs added is large (something like outer_func(x; verbose=true, kwargs...) then I pass kwargs to the inner function)?
Next, what if I have a certain design and want to remove kwargs?
The suggestion to package large numbers of kwargs into a struct makes sense to me.
I also like the “merge defaults” pattern:
function foo(; kwargs...)
# Note that `x = 17` works as well as `:x => 17`
defaults = (x = 17, );
args = merge(defaults, kwargs);
println(args[:x])
# Or call another function `bar(; args...)`
end