For 2GMP instead of using System.requestVersion() it is possible to create some custom logic to store the value of Version in PostInstallContext into some protected custom setting.

Then, when needed, the current package version can be read from that custom setting.

Another option would be to maintain the package version as a constant in some apex class and update that line with CI on every package version creation step.

Also, if you have access to Session Id and Tooling API, it is possible to perform Tooling Api query

    SELECT Id, SubscriberPackageId, SubscriberPackage.NamespacePrefix,
        SubscriberPackage.Name, SubscriberPackageVersion.Id,
        SubscriberPackageVersion.Name, SubscriberPackageVersion.MajorVersion,
        SubscriberPackageVersion.MinorVersion,
        SubscriberPackageVersion.PatchVersion,
        SubscriberPackageVersion.BuildNumber 
    FROM InstalledSubscriberPackage 
    ORDER BY SubscriberPackageId