You can get the CDI at AFIP and in the past it was possible to open a bank account with the CDI and a passport, but lately it seems to be more difficult than ever. It helps to have "connections" with some type of business.
AFIP also issues the CUIT (most banks ask for it or can access it by computer if you have a DNI). I believe that foreigners who own property here and pay taxes can get a CUIT even if they don't have a DNI.
ANSES does issue the CUIL, but not usually (if ever) to foreigners who only have passports.