Hi there!
A 40 gallon would be fine. I used one to house my two roborovski dwarf males. Space didn’t seem to be much of a problem at all, I was able to fit two of everything (including two 6in wheels) and still have plenty of space left. Forty gallons is a nice size in my opinion, some might consider it a bit small (I wouldn’t say it’s the best housing option for a Syrian) but it’ll be fine to use.
I really suggest doing research on keeping pairs if you haven’t already
Definitely be sure to have an extra cage on hand in case the two need separating. My robo pair had to be separated due to one picking on the other in his “teenage” phase. And let me tell you, you definitely don’t want to be caught in a situation where you only have one cage and two fighting hamsters!!
Good luck with you future fur babies!