(PUP-1806) Add varargs support to 4x function API
This commit adds additional methods to the 4x Function disptach to
allow declarations of required, optional, or repeated parameters. The
new methods replaces the current way of defining this using arg_count()
and last_captures_rest() and those methods are therefore removed.
NOTE: Care must be taken when merging this to master since new 4x
functions have been added there that makes use of the arg_count method.