V4 could have fit in the rear without needing the shoehorning of the Polo, would just need a different lid.
The Beetle needed a Watercooled engine by 1964, a whole decade earlier,IMO. The V4 was around. If they didn't want to use the competitor from over in Cologne, could have used the AMC Aluminum V4 from Toledo
Volkswagen could have done a lot of things differently including producing the FWD EA48, however even that featured a Flat-Twin version of the existing air-cooled engine.
Besides the AMC V4 was itself air-cooled as opposed to water-cooled and the only engines Volkswagen were willing to entertain was from Porsche (e.g. EA128, etc) prior to acquiring both Auto Union as well as NSU to merge them into Audi.
Volkswagen did carry over the larger Golf/Passat EA827 inline-4 engines to the Type 2 and Type 2 (T3) in OTL for certain markets (including a 5-cylinder version), so it is not completely outside the realm of possibility for non-US/European versions of the Beetle (and Brasília) or even the Type 3 and Type 4 models to carry over the inline-4 EA111 Polo engines and completely discontinue the Flat-4 engines. In fact the Type 3 / Variant derived Volkswagen SP2 was planned to be replaced by the Volkswagen SP3 featuring the larger 1.8-litre EA827 petrol engine.