How can I pass parameters to allowed_values_function for a field?
It's undocumented because it's not possible with core classes.

The options.api.php file refers to that callback as follows:


  That function will be called:
  
  
  either in the context of a specific entity, which is then provided as the $entity parameter,
  or for the field generally without the context of any specific entity or entity bundle (typically, Views needing a list of values for an exposed filter), in which case the $entity parameter is NULL.
  


There's no mention of being able to pass arbitrary parameters along to it. Indeed if you look at the invocation in options_allowed_values

$function = $definition-&gt;getSetting('allowed_values_function');
...
$values = $function($definition, $entity, $cacheable);


You can see that there's no scope for passing extra params at all. 

Hopefully you'll be able to get the required context from the entity, otherwise you'll need to find another way to make it available to your callback function.