No native speaker of French and English. According to: https://en.wiktionary.org/wiki/a_drowning_man_will_clutch_at_a_straw
"a drowning man will clutch at a straw"
has an equivalent shorter version
"grasp at straws".
According to https://www.linguee.fr/anglais-francais/traduction/grasping+at+straws.html one gets some ways to convey the desired meaning in French (not necessarily the Metropolitan French) such as:
It is total grasping at straws. On fait flèche de tout bois.
Or are we clutching at straws here? Ou parlons-nous à tort et à travers ?
and so on.
According to https://dictionnaire.reverso.net/anglais-francais/grasping+at+straws one may also use:
se raccrocher aux branches
e.g.
I mean, they must be really grasping at straws. Ils doivent vraiment se raccrocher aux branches.
Cf.
https://fr.wiktionary.org/wiki/se_raccrocher_aux_branches
https://www.languefrancaise.net/Bob/35991
EDIT
(Thanks to native speaker @Pas un clue).
'Se raccrocher aux branches'
is an option. In the exact contexte, one may use
«on tente de se raccrocher à n'importe quelle branche»;
or
«...à n'importe quoi»;
but it's not as colorful as the original English idiom. A couple of examples of usage in French: 1; 2. A literal translation from English to French is provided here. The image may not be customary in French, but very understandable nonetheless.
EDIT 2
(Thanks to native speaker @Personne)
Another way to convey the same meaning:
Se donner au premier saint venu.