The answer is no. You cannot avoid it. This could possibly be the shortest post I’ve ever written.
Lets take a step back for a moment. If you are seriously thinking about using PaaS are you really surprised that lock-in is more or less unavoidable? Think about all of the services that you plan on plugging into. Can anything be portable if you integrate/drop your code directly into a particular vendor and their services/compute? Yes, I know that there are cloud standards like Openstack but that has nothing to do PaaS. The majority of the Openstack standards apply to compute, network and storage. The various platforms tend to support a wide range of heterogeneous languages which is great. However, the languages are not what causes the lock in, its the API’s, the service bus, the analytics service etc. Yes, I know containerization is performing miracles and that its really portable … but does that really impact PaaS? I’d argue that when you are choosing a cloud vendor for PaaS that its not the languages they support that attracts you. Its not that you can scale compute on demand or get access to cheap databases (who doesn’t offer this?). The attractive services are the additional services like Analytics APIs and the Media/CDN services for example. The moment you start to use these services you are locked-in. Yes, of course you could move to another vendor but its going to take a lot of effort to do so. PaaS is not portable. But you already knew that. Vendor lock-in isn’t new and its not unique to cloud. Choose your vendors carefully because you will be working with them for quite some time.