add support for keyword arguments with static parameters, fixes #4087
add warning for unused static parameters, fixes #3062

note that without the fix for #4087, this might give redundant and/or
strange warnings in the presence of keyword arguments