Extract files with jq
Dump the contents of the ConfigMap as JSON, then use jq to generate a shell script that writes the files, and execute it.
kubectl -o json get cm/some-configmap \
| jq -r '.data | to_entries[] | @sh "cat >\(.key) <<\\END", .value, "END"' \
| sh -s