I have a 2018 13 inch macbook pro and Kernal_task takes up 40 GB of disk, is this normal?
...
You don't show in that Activity Monitor screenshot, that Kernel_task has used that much space --- only that Kernel_task has written a lot of files. Some, or most, of those files may be temporary files of some kind, maybe system caches, which are written, then over-written, then some more.
Bottom line, 40 GB of writes is unusual, but probably some normal result of something that the system is doing - or something that
you are doing, causing a lot of activity by kernel_task. As that echoes to some extent, what the system is doing at the time, hard drive
space is probably not changing all that much, particularly if you check that space after a restart.
(More important would be CPU use and memory use by kernel_task process. That's probably high, as well (and still not anything to worry you too much...)