I’m pretty sure that this entirely hinges on what you mean by “log into my gmail.” There is an entire spectrum of ways you can do that on an iPhone. Off the top of my head, the most invasive and comprehensive way (assuming each person has their own iCloud account like you said) would be adding the account to Accounts and syncing everything (including Notes, Contacts and whatnot). The least invasive way I can think of would be logging into Gmail in a private Safari tab and then closing it afterwards.
Basically, there are some ways of logging into Gmail (or, more precisely, your Google account) that will deeply imbed your entire Google account into the iOS device. I don’t fully understand it, but can tell when it’s happened because you’ll be automatically logged in (or at least able to choose an already-present Google account) when downloading a new Google-owned app. Do not log in to your Google Account on any Google-owned app such as Gmail, Google Drive, Google Maps, Google Calendar, Google Smart Lock, etc. (on a shared device… if you care about your privacy). I have found that doing so always causes this to happen.
I’m like 80% sure that signing into Gmail via gmail(.)com on a Safari private tab would not add your entire Google account to the device like that. You may have to sign in each time, but it wouldn’t be that inconvenient if you’re using a password manager (especially one with FaceID unlock enabled). There might be more convenient ways to pull it off, too. Other browsers such as Firefox may let you log in to Gmail in non-private windows without adding your Google account to the device.
Btw, idk what you’re currently doing OP but to anyone reading this I highly recommend just using Apple’s Mail App instead of the Gmail App if you have a Gmail or Google Workspace account. iOS 15 added excellent new mail privacy features, whereas the Gmail app is bound to be a privacy nightmare. I have 2 separate paid Google Workspace accounts that use custom domains, and then regular Gmail accounts on top of that, and I’ve been using solely the Apple Mail app on my iPhone for years with no issues. Maybe I’m missing something but I just don’t see any reason to use Gmail instead of Mail.
The only problem I have with the Mail app is that, even in iOS 15, it still does not give you any sort of indication that an email address is spoofed if you receive a spoofed email. Gmail (at least on the web) will detect spoofing (which is incredibly easy) and give you some sort of yellow warning like “Be careful with this message.”