This is basically a bootstrapping problem and turns out to rest on these critical functions:
- being able to create a file containing arbitrary data
- being able to make a file executable
- being able to execute a file
Would the same be possible if your shell was not bash but one with fewer features, like e.g. POSIX sh? That doesn't even require echo to be a builtin (it only has the 3rd function above), so it might be a dead end, but maybe there's some other way...