This has been fixed in the sources for the June 2025 LaTeX release.
Old:
\def\IfPackageLoadedT #1#2{\IfPackageLoadedTF{#1}{#2}{}} New:
\def\IfPackageLoadedT #1{\IfPackageLoadedTF{#1}\@firstofone\@gobble} the new version avoidavoids reading the code argument with the macro defined via \def which is not \long. The code argument is read with \@firstofone or @gobble depending on the result of the test. The argument taking the package name is still read with a non-\long macro, so blank lines (or missing }) for that argument are flagged.
Several other \If....T macros are similarly adjusted.
https://github.com/latex3/latex2e/commit/8dcd37fa5d84bc95efcdedf7919ac7febbac44d7