Yes, everything affects performance. But does it meaningfully affect performance? No, Roblox caches the require result after the first time a script has been required, so you’re just being handed the same result in a different manner.
The time difference with a loop running one million times is 0.1275ms vs 0.0503ms
The performance difference is very negligible so you should do whatever makes sense for your implementation. Don’t waste your time thinking of optimization in regards to minor stuff like this, it’s always unimpactful. You bring up memory but think about it, how much memory could the variable possibly take?
Also, you can easily write a test for your situations and then benchmark them. Just time the execution over a set amount of iterations, then compare. Measuring is always best if you’re in doubt.