For example, if I am doing a PhD in France, with no intention of staying in France afterwards, wouldn't it be rather inaccurate to call myself an immigrant to France?
If you're in a foreign country, you're either an immigrant (as a generic term) or, if you want to get pedantic, you can use whatever more apt definition they have (visitor, migrant worker, non-immigrant, etc).
Immigrants and expats are overlapping terms, but there are some differences in common usage. An immigrant may intend to stay in the host country permanently and make it their new home, while an expat just happens to live there for the moment, often for a specific purpose. Expats are often more privileged than immigrants. An immigrant may seek to integrate into the society and the culture, while expats are more likely to have a purely transactional relationship with the host country.
That said, it is expat and emigrant that overlap, not immigrant and expat.
An expat is someone who has left his country, with varying degrees of permanence and volition. Eg: to be exiled is to be expatriated by force.
Absurd example: you could technically be an expat without immigrating (or visiting) any other country if you kept to international waters (or unclaimed space?).
The distinction between "expat" and "immigrant" is made by governments as well. Example: as someone who over time held multiple non-immigrant and dual-purpose visas, became an immigrant (permanent resident), then naturalized, I can tell you "expat" was nowhere to be found on the dozens of INS and USCIS forms I've had to fill out. It was never a status I could apply for or one I was given. On the other hand: the US embassy, and my home country's embassy, do offer me "expat services" where I currently live.
An immigrant is someone who moves to a country other than their own with the intention of residing there for a significant period (usually at least one year), regardless of their ultimate intention to stay permanently or leave later.
An "expat" is just a white economic migrant.
They'll try to spin it. They'll whip out irrelevant definitions. They'll invent arbitrary distinctions.
They are wrong.
"Economic migrant" has always, does now, and will always include "seek higher standard of living" in its context and definition and "well I just, you know, kinda vibe with the culture" and/or "I like, you know, just consider myself a global citizen and want to see the world" is "seek higher standard of living".
I believe, as others have stated, that the educational way is probably the most practical, as you can get a residency visa based on attending school (not necessarily a graduation, I know plenty of people that initially came to study the language, and that would qualify you for such visas), and subsequently after living there for a while follow the normal paths towards long-term residency.
As far as I'm aware, the Netherlands and Germany are destinations that have reasonably well-understood processes for immigration and a significant technical market. Both of these countries also have the advantage that you can mostly live your life in English – albeit you should of course strive to learn the local language if you intend to settle there.
For Germany specifically, there's been a recent reform in the laws which give you a very fast track even towards German citizenship, which then would allow you to live and work anywhere in the EU. On the other hand, the Netherlands seem to have a more digitalized bureaucracy, which can be practical: in Germany everything is still done by snail mail.
I've also heard good things about Switzerland, but there I have less personal experience. It is also not in the EU, for what it's worth.
That being said, I'd point out that from a technology market perspective, it's certainly more difficult to find employment at the moment than it was perhaps 10 years ago. This comes and goes in cycles, so I'm saying that so you don't get discouraged if it takes long and requires applying to hundreds of positions: that's the case even for us natives. There's geopolitical and macroeconomic reasons for that, interest rates, etc.
I wish you the best of luck!
P.S. Of course, if you're so inclined, you might want to be aware that Svalbard has no specific visa requirements for residence. You could conceptually move there tomorrow, as long as you're allowed to transit through Norway, which assuming you hold a US passport shouldn't be a problem.
https://en.wikipedia.org/wiki/Svalbard
However that place is certainly... not for everyone :-)
P.P.S. On a more serious note, and it's of course not the EU, but Australia has very friendly immigration paths and I personally know multiple people who were able to move there, quickly obtain work in technology, and two of them actually obtained Australian citizenship by now.