A German rental contract can be verbal and still binding, which leads people to conclude that a written one is optional for a short sublet. It is not, and the reason is not distrust of your host. It is that a written agreement is the only artefact proving the arrangement exists — for the Bürgeramt, for your employer, for your own claim on the deposit, and for a visa process if you have one.
For a sublet the document you want is an Untermietvertrag, and it does not need to be long. Names and addresses of both parties; the address of the flat and what exactly you are renting, a room or the whole place; the start and end dates; the rent and what it includes; the deposit and the terms for returning it; and a line confirming the main tenant has permission to sublet. That fits on two pages. Templates in German and English are freely available and a good host will already have one.
Read the deposit clause specifically, since that is where the money is. Look for when it is returned — a specific number of weeks after you leave, not “in due course” — and what may be deducted. Take dated photographs of every room on the day you arrive and the day you leave, and send them to your host at the time. Almost every deposit dispute is a disagreement about the state of a flat that neither party documented.
If the arrangement is genuinely casual — a friend of a friend's spare room for three weeks — a signed email covering those points is far better than nothing and takes five minutes to write.