Neither removing the license, or converting to a shared mailbox remove the One Drive Files. Only deleting the user from Azure or removing the user from an AADConnect sync from on-prem does that. One Drive has no idea what type of mailbox is being used.
The retention period for cleanup of OneDrive begins when a user account is deleted from Azure Active Directory. No other action will cause the cleanup process to occur, including blocking the user from signing in or removing the user's license. For info about removing a user's license, see Remove licenses from users in Microsoft 365 for business.
If the user is coming back however, I see no reason to remove the license, but simply converting to a shared mailbox and removing that license will not affect OneDrive as long as the user exists in Azure and is not deleted.