Could congress prevent SCOTUS from invalidating laws?

I would say no, because the function of judicial review is the core of the judicial power. The Congress can make particular exceptions by subject matter, as in McCardle’s case, but to take away the Court’s power of judicial review would gut the court of its core constitutional function.

The supremacy clause is important, but the starting point is the opening words of Article III:

It is that delineation of the judicial power which is the source of the Court’s power of judicial review, because a question whether a law is consistent with the Constitution is a case “arising under this Constitution, [and] the Laws of the United States”.

That is the core function of the judiciary, just like enacting laws is the core function of the Congress, and taking “care that the laws be faithfully executed” is one of the core duties of the President. One branch can’t take away the core functions of another branch.

The Supremacy clause (Article VI) is important to that analysis, because it clearly states that the Constitution itself is a law, and the supreme law, at that. That was the key foundational distinction between the Constitution and the Articles of Confederation: the Articles were a treaty alliance between sovereign states, but the Constitution was the result of the sovereign law-making function of the people of the United States. That was why Madison in particular insisted on ratification of the Constitution by individual state conventions (Article VII), rather than by the state governments. The Constitution drew its authority directly from the people, unlike the Articles, which drew their authority from the state governments. The Constitution is a law, not a political agreement.

And that leads to the core of Chief Justice Marshall’s statement in Marbury v Madison:

What he is saying is that between the different types of laws listed in Article III and in the supremacy clause, it is the core function of the courts to determine how those laws relate to each other, and in case of conflict, which one governs. He concluded that in case of a conflict between the Constitution itself, and a law “made in pursuance of” the Constitution, the Constitution had to govern. Otherwise, laws “made in pursuance” of the Constitution would be exceeding the authority granted by the people to the federal government in the Constitution.

It’s sometimes said that Marshall CJ just made judicial review up out of whole cloth, and there’s no basis for judicial review in the Constitution, but it is there, in those provisions. And, he didn’t make it up. It was foreseen by the drafters of the Constitution.

For example, in Federalist 78, Alexander Hamilton clearly states that judicial review is implicit in the judicial branch:

Since the it is the core function of the courts to determine the relationship between the Constitution and laws passed by the Congress, an attempt to strip the Supreme Court and the federal courts of all jurisdiction to do that would be unconstitutional, in my opinion.

Now, could the Congress strip the Supreme Court of that power by means of reducing its appellate authority, but leave the inferior courts the power of judicial review? After all, in that model, the “judicial power” under Article III would still be able to review the constitutionality of laws. Maybe. But my bet would be that the Supreme Court would rule that since the judicial power is vested in both the Supreme Court and inferior federal courts, there would be limitations on stripping the Supreme Court of judicial review in general.