From man open on macos:
The open command opens a file (or a directory or URL), just as if you had
double-clicked the file's icon. If no application name is specified, the
default application as determined via LaunchServices is used to open the
specified files.
So what that commend is doing is just opening the file in whatever the default editor is. Since ~/bash_profile is a plain text config file, you can open it directly using whatever text editor you prefer (e.g. gedit ~/bash_profile , nano ~/bash_profile, etc.).
There are also a few options for opening with an automatic default editor
My personal preference is to be more intentional with what programs I'm using. However you can try out those options and see what works, and what works best for you.