As a reference we have itty-router, which implements these operators.
The implementation would be something like:
? fills the parameter only if present.
* always returns an array to the associated parameter and may be empty.
+ always returns an array with the parameter associated with at least one element.
The algorithm would dynamically increase the number of routes according to the parameter match and use the current route weight.