It’s weird, I‘m not sure I agree that having DCs for puzzles helps roleplaying. Quite the opposite, I think. They prevent roleplaying.
In my experience, players don’t roleplay when they know they can just roll dice to resolve an obstacle. See combat devolving to blandly repeating endless variations of “I swing, I hit, I do 3 damage”. The players immersing themselves in the fantasy world by describing what their characters actually do in that fantasy world is roleplaying.
Whether those actions are “in character” or not is beside the point, to me. You can’t really separate “what the character would do” from how the player decides to play them. Any version of “that’s not what a thief in the fantasy world would do” is easily countered by “well, this one would”. It’s not up to the table or the DM how a player plays their character.
I will frequently give people bonuses or advantage to checks depending on what they say or do.
But it also just depends, is the door locked because it's critical to the story or is it just locked because people lock doors and opening the door is time critical? Sometimes a cigar is just a cigar, sometimes a lock is just a lock. Sometimes I just handwave it because they have all the time in the world.