I understand that this topic has been up many times but need to confirm something.
When 'Paste as plain text' is used, data in paste event will always have some minimal formating done to original text like <p> <br> tags in places of newlines \n.
editor.on('paste', function (evt) {
var text = evt.data.dataValue;
console.log(text);
});
So data in the text variable is never 'exatly' the same as the original txt file, that has no htm tags in it??

Yes
That even seems to be the case even when the pasted text was copied from the same CKEditor document. For example, copying the line
<?php echo "hello world"; ?> in a preformatted section with three examples of such and pasting it below itself results in the following page source:
<pre>
<?php echo "hello world" ?>
<?php echo "hello world" ?></pre>
<pre>
<?php echo "hello world" ?></pre>
<pre>
<?php echo "hello world" ?>
<?php echo "hello world" ?>
<?php echo "hello world" ?>
</pre>
The brackets and quotes are correctly changed to html entities, but the line spacing goes to hell. In fact there were no CR's in the pasted section so there should not be any newlines, but in fact several are inserted.
There is apparently a fix out for other paste issues, but haven't tested it with preformatted code yet. Interesting to know if it fixes this.