The canonical way if you need a version number is the "about this Mac" dialog (here it says Mac Studio 2022).
If you need to be technical, System Information says Mac13,1 and these identifiers have been extremely consistent for about 30 years.
Your product number encodes much more information than that, and about the only time when it is actually required is to see whether it is eligible for a recall.
> Oh also the Macbook Air (2020) is a different processor architecture than Macbook Air (2020).
Right, except that one is MacBook Air (retina, 2020), Macbookair9,1, and the other is MacBook Air (M1, 2020), MacBookAir10,1. It happens occasionally, but the fact that you had to go back 5 years to a period in which the lineup underwent a double transition speaks volume.