I bought a car in Portugal last year without being a resident. Super simple. You will need a local tax number, but it is easy to obtain and you do need a local address to register the car to, but beyond that it was not an issue at all that I am not a resident.