Steps:
1. Settings > Screen time > Use screen time pass code > Enter a different passcode to your main one that you will remember
2. Settings > Screen time > Content & Privacy Restrictions > Scroll down to Account changes > Don’t allow
This prevents account changes from the device, unless you have the second passcode.
This would not prevent a thief who was aware of this (they could attempt to disable screen time then request the second passcode), but it would prevent a pickpocket who happens to see your passcode being entered from changing your iCloud account details.