Bicycle sharing seems to be very popular now in China. I can see bikes from ofo and mobike everywhere.
Is there a way for a foreigner without a Chinese ID or a Chinese bank account (but having a temporary Chinese phone number) to rent these bikes?
Yes, definitely. And I'm using it now in China.
To use mobike, just download the app and log in using your Chinese phone number, and deposit the money (299 RMB). Then on the registration page, tap the "people without Chinese ID" button (maybe it is written in Chinese... I don't remember), which leads you to a registration page for a foreigner.
Note that the registration page still shows you to type in "Chinese ID" (I think it is a bug), but you can just type in your passport number in the field. Then it leads you to another page where you upload your passport and a photo of you having the passport, and after the verification is completed, you can start to ride it.
However, to send the deposit, you might need a bank account since it uses either AliPay or WeChat Pay. There seems to be a way to use these service without a bank account, though.
I'm not sure about ofo (the app doesn't show most pages due to unknown errors... maybe because I use iOS 11 Beta), so I stick with mobike only.