What if Scotty is not actually Scottish, though?
Like, what if his name just happens to be Montgomery Scott, so all of his friends started calling him “Scotty,” and then every time he was introduced to a new person, they would be like “Oh, are you Scottish? My uncle was Scottish!”
And finally, he just gets sick of explaining the situation, so he starts replying with “aye, laddie!” But then it turns out that the person he said that to was Captain Kirk, and he doesn’t want to admit that he lied to his new commanding officer, so he has to keep speaking in a ridiculously over-the-top brogue and commenting constantly on how much he loves drinking Scotch, and by the time that he realises that Kirk would have found humour in the situation, he’s in too deep and can’t stop pretending, and it gradually just becomes his normal speech pattern.
Then, years later, the Enterprise is being inspected by a Starfleet engineer who’s actually Scottish, and Scotty takes him on a walking tour of his warp engines and is all like “Auch! Here be me wee bairns!” and the other engineer is just like “what the fuck is wrong with you?”
I take the fact that James Doohan is Canadian as evidence of this theory.
Scotty hacking into his Starfleet personnel file to alter his place of birth.
Scotty soundproofing his quarters on the Enterprise so that no one can hear him teach himself to play the bagpipes from instructional videos.
Scotty making a great show of taking a shuttle down to Aberdeen to “visit his family” every time the Enterprise is in Earth orbit and then, once on the ground, discreetly site-to-site transporting himself to Vancouver or whatever.
None of these things are out of character or beyond his technical ability.
Yeah, but also in character: Jim Kirk has known since Day 1 that Scotty is not, in fact, Scottish, but is just sitting there waiting to see how far Scotty is willing to go to keep the story going. It started out as an “enough rope” situation but now it’s one of Jim’s greatest ongoing sources of entertainment and he wouldn’t admit at gunpoint that he knows.