I think we should choose the latter, so I modified your patch as mentioned, after re-creating it on top of my patch. Attached is a new version (0002-Allow-join-pushdown-even-if-pseudoconstant-quals-v2.patch). I am attaching my patch as well (0001-Disable-join-pushdown-if-pseudoconstant-quals-v2.patch).
Other changes made to your patch:
* I renamed the new member of the ForeignPath struct to fdw_restrictinfo. (And I named that of the CustomPath struct custom_restrictinfo.)
That's much better, and more consistent with other members in ForeignPath/CustomPath. Thanks!
* In your patch, only for create_foreign_join_path(), the API was modified so that the caller provides the new member of ForeignPath, but I modified that for create_foreignscan_path()/create_foreign_upper_path() as well, for consistency.
LGTM.
* In this bit I changed the last argument to NIL, which would be nitpicking, though.