How to let editors place custom forms? I have a custom form:

\Drupal\module\Form\CustomForm


I want to be able to embed this form in a basic page by adding a shortcode/variable to the basic page such as:

[form][/form]


or

form


This is very easy to achieve in WordPress but really difficult in Drupal.

How can I achieve the above?
As also WordPress is now moving towards modular content (codename Gutenberg) I'd advise you to do the same in Drupal with Paragraphs.

Then you can provide different paragraph types (image, text, CTA etc.), one of them could be a simple block reference (I don't remember if core already offers block reference fields or
if you need Block field for that) with which you let editors choose blocks to be placed wherever they want. (Paragraphs also are resortable.)

So, you already have your form, cool. Next level is to let your custom module provide a block that outputs this form. Next, In your theme add a new region "Disabled" (that never gets printed anywhere) and place your block there. Now this block will be available to choose as block reference. (I guess it's desired behavior that only blocks that are assigned to a region can be referenced.)

Bonus would be a little bit of back-end JS to only display certain blocks in the block reference select list. But that's just bonus.