What's the best way to assign variables for use in multiple form modules?
It's hard to say what is the &quot;best&quot;, but you can write a class, add the variables as constants, and then import the class wherever you need it.
For example, in MYMODULE/src/MyVariables.php:
&lt;?php

namespace Drupal\MYMODULE\SharedStuff;
    
/**
 * Defines variables that need to be shared throughout the site.
 */
class MyVariables {

  // Seconds in an hour.
  const HOUR = 60 * 60;
  // Seconds in a day.
  const DAY = 24 * self::HOUR;
  // Seconds in a week.
  const WEEK = 7 * self::DAY;
}

And then in the PHP files where you need the variables:
use Drupal\MYMODULE\SharedStuff\MyVariables;
And then for the variable: MyVariables::HOUR