Unfortunately, AFAIK, there is no software or user-side workaround to clear a forgotten UEFI lock on a Microsoft Surface Pro 7 because the password is stored directly in the device's security hardware.
Depending on the situation, a few limited options exist.
The first is hardware flashing, which involves physically removing the motherboard's UEFI flash chip and reprogramming it using an external hardware programmer. This requires specialized equipment and micro-soldering skills. On a Surface Pro 7, tampering with or replacing the chip carries a significant risk of permanently damaging the device or breaking functionality such as the touchscreen.
Another possibility is to determine whether the Surface was previously configured with Surface Enterprise Management Mode (SEMM). SEMM is an enterprise tool used by organizations to manage Surface firmware. If the previous owner's organization enrolled the device using SEMM, a configuration reset package created with the organization's original enterprise certificate may be able to remove the lock. If the device was locked using a standard consumer UEFI password, SEMM will not provide a way to bypass it.
If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.
hth
Marcin