I do this kind of code switching (particularly in social situations) all the time without really intending to. If I’m talking to US Southerners I start adopting a bit of a drawl. When I am in the NorthEast - New Jersey, Boston or Maine comes out. When I’m in Ireland, a bit of a lilt starts. In Scotland, it’s a bit of a brogue. I don’t intend it, but I can’t help it. It’s some sort of intrinsic mimicry.
Somewhat interestingly, this doesn’t happen in professional circumstances; then I keep a very neutral US Midwestern accent. It also never happens with others whose native language is not English.