I really have to wonder where on earth people get this misconception that search engines penalize "foreign" TLDs. What is a "foreign" TLD in the first place? Depends on where you sit, where the SE sits, and finally where your user sits, right?
Basically it's like this:
generic TLDs com, org, net, info, biz
Then there's edu and gov, which are generic, but only inside the US. Don't know the historic background.
cc (country code) TLDs us, fr, se, pl, ru, de, dk, ...you name them
In theory ccTLDs should be used by people inside the country. In practise this has for most ccTLDs never been that way.
Now all major engines operate international. To them a TLD means nothing. They only use TLDs for filtering, like giving users the option to filter for results from a country. And even in that respect it's a secondary criteria: language is the primary.
So on what grounds should SEs penalize domains under a specific TLD?
> So on what grounds should SEs penalize domains under a specific TLD?
Does this mean that in a hypothetical situation where all else is equal, example.com would not rank any higher than example.fr when searching on google.com?
And also, example.com would not rank any higher than example.fr when searching on google.it?
No. And why should it?
If a user wants to filter for local results, or results from his native language, he can always do so from the search options.
If a user searches the www, there's absolutely no reason to prefer one TLD over any other.