Since JupyterLab v4.3 you can finally do this by setting skipKernelRestartDialog to true (thanks to primfaktor for pointing to the GH issue).
You can do this either directly in the UI ("Settings" > "Settings Editor"), then select "Kernel dialogs" and check the checkbox for "Skip kernel restart Dialog".
Or, you can directly set the value in JSON in the appropriate config file, e.g., at ~/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/sessionDialogs.jupyterlab-settings:
{
"skipKernelRestartDialog": true
}
Your path may differ, call jupyter --paths to check.