It should be fine. You'll have to be thorough in removing personal information. I would prioritise giving it to someone I know rather than a complete stranger.
Everyone else seems to be very concerned about the terms of service, but I don't know why ToS is of utmost importance to everyone suddenly. Anyone would gladly share their streaming service passwords, would previously rip CDs or DVDs, use VPNs to circumvent porn restriction laws in their country, lied in sites/apps to sign up as a teen, etc......suddenly Steam ToS is somehow sacrosanct.
This came up recently when Steam confirmed your account cannot be left to anyone else when you die. The conclusion everyone seems to mention there is: if you leave your username and password in your will, how would Steam ever know or enforce this?
Go ahead. Do what you want.