Disclaimer : This post doesn't uses BORI CE as it's only source, it uses Puranas as well
In the Mahabharata, we get references of Ashwatthama being incarnation of Shiva,
The brave and lotus-eyed Ashvatthama, of great valour, tormentor of enemies and fearful to enemy armies, was born from three parts of Mahadeva that merged into one—yama, kama and krodha.
Adi-vamshavatarana Parva
Know that your energy and anger have also been born from Rudra. You were as wise as a god. Knowing that the universe is pervaded by Bhava, you yourself emaciated yourself so as to please him.
Drona Parva
Not only this, Shiva and Kali along with their ganas help Ashwatthama to destroy the Pandavas on 18th day night.
However, Ashwatthama's actions and behavior becomes interesting if he really was the incarnation of Shiva. Why did he do what he did if he was Shiva or part of Shiva?
While Mahabharata itself doesn't answer it that much, Shiva Purana mentions interesting things about Ashwatthama's life.
In the Śatarudra-saṃhitā of Shiva Purana, multiple incarnations of Shiva have defined and one of them is Ashwatthama.
Shiva Purana says that Drona did a penance for Shiva,
6. The most excellent brahmin Droṇa performed an elaborate penance with Śiva in view for obtaining a son in order to help the Kauravas.
7. O excellent sage, then the delighted lord Śiva, favourably disposed to his devotees, appeared in front of Droṇa.
8. On seeing him, the brahmin Drona whose heart was highly delighted bowed to him with palms joined in reverence and eulogised him.
9. Satisfied and pleased with his eulogy and penance, lord Śiva, favourably disposed towards his devotees told Droṇa—“Mention the boon you wish to choose”.
10. On hearing the words of Śiva, Droṇa bowed low and said—“Please give me a son born of your part who will be invincible to every one and who will be very powerful.
It also describes Ashwatthama as the primary reason Pandavas couldn't win initially,
16. By resorting to that powerful hero, Bhīsma and other Kauravas became invincible even to the gods.
17. Fearing him, the Pāṇḍavas, though they were great heroes and very skilful, became incapable of conquering the Kauravas.
And Krishna and Arjuna had to please Shiva himself to finally overcome the Kauravas
18. At the instance of Kṛṣṇa, Arjuna, performed the severe penance of Śiva and obtained a divne missile duo to Śiva’s boon. He then conquered the Kauravas.
Regarding the Bramhastra episode, according to Shiva Purana, on seeing the Bramhashira, Arjuna meditated on Shiva and used the "saiva" weapon to counter Ashwatthama's weapon which is different from Mahabharata.
But the interesting thing is Ashwatthama has no guilt of doing any of this,
32. O sage, knowing that this happened by the influence of Śiva, Aśvatthāman, born of Śiva’s part and delighted in heart at Śiva’s wish, was not at all sorry.
And the events of killing Parikshit also happen differently here. Ashwatthama of Shiva Purana sent the Bramha weapon towards Uttara not because he didn't know how to withdraw his original weapon like Arjuna, but simply because he wanted to .
Krishna too realized that it can't be countered, so he sends Sudarshana to protect Uttara. And thus, Shiva inside Ashwatthama, on the behest of Krishna (who is Shiva's greatest devotee) refrained from the thought of destroying Uttara.
In fact, the very next moment, Krishna makes all the Pandavas bow down to him,
39. Then the leading devotee of Śiva, the delighted Kṛṣṇa, made all the Pāṇḍavas fall at the feet of Aśvatthāman for pleasing him.
40. Then Aśvatthāman, son of Droṇa, highly delighted in the mind, blessed the Pāṇḍavas and Kṛṣṇa with various boons.
Ashwatthama gives both Pandavas and Krishna boons and unlike original Mahabharata Krishna doesn't curses him to roam around the world for 3K years.
The excerpt however does mentions he's still alive near Ganga bank these days.
So basically Shiva Purana makes one of the most underrated characters of Mahabharata as part of supreme God himself.
In fact, it also tells benefits of worshiping and narrating stories of Ashwatthama
He who listens to this with devotion or narrates it with pure mind attains all Siddhis here and attains Shiva’s abode hereafter.
The incarnation in the form of Aśvatthāman of lord Śiva has been explained to you. It is the cause of all Siddhis and it fulfils all desires of the devotees.
Of course, this whole narrative is heavily edited by the Shaivas in their puranas. But it's still interesting to note how Ashwatthama is one of the only Mahabharata characters who is glazed to worship level in texts outside of Mahabharata (barbarik doesn't count because he's not mentioned in Mahabharata)