This is what proper diagnostic tools are for...
At most, after a successful repair, we will check that the customers HDD boots up to whatever, log in screen, desktop etc. We don't want or ask for log in credentials. We simply ask that the BIOS is either set to boot from other devices or they give us (ore remove) any BIOS/BOOT passwords so we can boot an external USB device or temporarily replaced HDD of our own. If the HDD has failed, we replace it. We don't do data recovery but if asked, we'll return the faulty HDD to them.
Generally, we only ever need to boot the manufactures diagnostics tools to confirm the fault and then confirm it's fixed afterwards. Sometimes we do a quick and basic install of Windows depending on the quality of the manufacturers diags tools and likewise, use the manufactures tools to check and update any firmware such as Bios, Intel ME, Thunderbolt etc.
This is almost all warranty repairs mind and only rarely non-corporate customers, so mostly the HDDs are encrypted anyway.
On top of that, anyone caught browsing around a customers HDD contents would be walked out the door and they all know that.