I'm a complete beginner really enjoying learning how to code (currently in Python) and my first games will be very simple, mostly text based, but I'd like them to run on friends' phones and computers on various platforms, including windows, linux, mac and android. Is this easy to do without using a game engine, or should I use, say, Unity? If I use Unity will I still be learning to program in code, or is it silly to use a game engine for a game that is simple, like a 'choose your own adventure' game or, later, an ascii roguelike? Thanks.
This question skirts close to off-topic "what technology to use" territory, but I'll try to keep from getting bogged down in this-product-vs-that details, and look at it more in terms of general development process...
Philipp is right that using a full-featured 3D engine for a text game is using a sledgehammer to crack a nut, ie. much more power than you really need, but I think there are several reasons why as a beginner this isn't a bad idea:
The problem you're solving isn't text (which is reasonably modest), it's cross-platform compatibility (which is reasonably thorny). Using a development environment that solves that for you lets you focus on learning the game bits of what you want to do, rather than the platform particulars.
You're probably not jumping straight to commercial games where you need to justify to customers why your game has a particular file size. Sure, these engines contain a lot of unnecessary bloat for what you want to do, but if you're just sharing them with friends then they probably won't mind that much.
A game engine already has a lot of the supporting code that's helpful in making games, but can be a deep rabbit hole to try to engineer from scratch, especially if you're new and don't have a feel for it yet. I've seen beginners get lost for weeks implementing their own update loops, component systems, dependency graphs, etc. with all the most fashionable features talked about on gamedev blogs... and not making anything playable. An engine lets you jump straight to the gameplay bits, and branch out to the supporting tech only as the interest strikes you.
This gives you a lot of flexibility. If halfway into making your text game a friend says "hey, you should put on a CRT distortion & scanline shader so it looks like those old text adventures!" or "wouldn't it be cool if stuff I do in my game could affect yours" - implementing those ideas might mean re-engineering your whole rendering loop or building a networking layer from scratch in your own tech. In any of the big-name game engines, these features are already there for you to use anytime an idea strikes you.
That said, there are a couple of other approaches worth considering:
Look for a game library that has good cross-platform support built in. I haven't gone this route so I can't recommend any from experience, but you can take a scan over the tutorials they offer for each of the platforms you want to target. If each platform version has a lot of steps different from the others (or if the tutorials themselves are hard to find/understand) then it's probably not as painless as advertised and you should weigh how much time you want to spend focusing on these types of issues versus just writing your game itself.